tomsontang / redux-saga-model Goto Github PK
View Code? Open in Web Editor NEW从 dva 中抽取出对 model 的处理
License: MIT License
从 dva 中抽取出对 model 的处理
License: MIT License
我是新手小白,在项目开发的过程中,遇到了一些需求,就是model和redux-saga的整合的问题,我看了一下,当前项目的lib和src是个什么关系?我不太明白的调用,我看了 一下你的样例,没有用的lib的内容的。
第二个,就是dva升级到2.x版本,和这个的差异是什么样的?
/lib/index.js
// internal model for destroy
this.register({
namespace: "@@saga-model",
state: 0,
reducers: {
UPDATE: function UPDATE(state) {
return state + 1;
}
}
});
// 将当前 prefix 放在 state 中方便使用者直接获取
this.register({
namespace: "@@saga-model-prefix",
state: this.prefix(),
reducers: {}
});
这里注册的时候没有带hot参数,好像会导致控制台报错
Error: modelManager.model: namespace should be unique :@@saga-model ,if use webpack please use register with hot parameter
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.