
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
dua是封装的基于dva的数据流,主要是为了统一model的数据结构,减少大量重复性的创建model相关的代码
对后端的API有一些要求,这些要求可以让数据更加统一
单条数据
{
code: 200,
message: 'success',
data: {
id: '111',
xxx
}
}
多条数据
{
code: 200,
message: 'success',
data: {
list: [
{
id: '111',
xxx
}
],
total: 1
}
}
import { create } from 'dua';
//可以换成其他的请求库
import request from 'umi-request';
export const fetchUser = () => request.get('/users');
const model = create('user', {
fetch: fetchUser,
});
export default {
namespace: 'user', //umi3会对model文件进行识别,umi2不需要这个
...model,
};
import React from 'react';
import { connect } from 'dva';
const Example = (props) => {
const { users, dispatch } = props;
React.useEffect(() => {
dispatch({
type: 'user/fetch',
});
}, []);
return (
<div>
{users.map(i => (
<div key={i.name}>{i.name}</div>
))}
</div>
);
};
export default connect(({ user }) => ({
users: user.allIds,
}))(Example);
FAQs
dva based data flow!
We found that dua demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.