React & redux-saga & effects & Generator function & React Hooks
React & redux-saga & effects & Generator function & React Hooks
demos
https://github.com/sorrycc/blog/issues/62
https://umijs.org/zh/guide/with-dva.html#model-注册
https://www.jianshu.com/p/6f96bdaaea22
dva & effects
https://dvajs.com/knowledgemap/#effects
effects & put & call & select
https://dvajs.com/guide/introduce-class.html#effect
https://dvajs.com/knowledgemap/#effect
demo
https://github.com/sorrycc/blog/issues/62
# dva-cli version 0.10.1
$ npm i dva-cli@next -g
$ dva -v
# 1.0.0-beta.2
# user-dashboard
$ dva new user-dashboard
$ cd user-dashboard
配置代理,能通过 RESTFul 的方式访问
修改 .webpackrc.js,加上 "proxy" 配置:
// proxy
"proxy": {
"/api": {
"target": "https://jsonplaceholder.typicode.com/",
"changeOrigin": true,
"pathRewrite": { "^/api" : "" }
}
},
Tip
https://jsonplaceholder.typicode.com/guide.html#nestedresources
you can use
http://
orhttps://
when making requests to JSONPlaceholder
// fetch
fetch('https://jsonplaceholder.typicode.com/todos/1')
.then(response => response.json())
.then(json => console.log(json))
https://jsonplaceholder.typicode.com/users/1/todos
https://jsonplaceholder.typicode.com/users/1/albums
https://jsonplaceholder.typicode.com/users/1/posts
ES-Next & ES7 @decorator
https://www.cnblogs.com/xgqfrms/p/10971637.html
shit dva-cli tutorials
https://github.com/xgqfrms/dva.js-practice/issues/2
umi 2.0
create-umi 《umi + dva,完成用户管理的 CURD 应用》
https://www.codercto.com/a/25627.html
https://github.com/Ivocin/umi2-dva-user-dashboard
refs
https://zzk.cnblogs.com/my/s/blogpost-p?Keywords=redux-saga
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/11545532.html
未经授权禁止转载,违者必究!