mini-dva.js
v1.0.0
Published
Pure-Dva for managing state
Downloads
1
Maintainers
Readme
Pure-Dva.js
纯粹的 Dva 模块, 只注重于状态管理
import ReactDOM from "react-dom";
import dva, { connect } from "@/utils/dva";
import { createBrowserHistory } from "history";
import appModel from "@/models/app";
// 1. 初始化Dva对象
const app = dva({
history: createBrowserHistory(),
});
// 2. 注册插件
// app.use({});
// 3. 注册 Model
app.model(appModel);
// 4. 启动
const DvaProvider = app.create();
ReactDOM.render(
<DvaProvider>
<OneComponent />
</DvaProvider>,
document.getElementById("root")
);