xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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 的方式访问

http://localhost:8000/api/users

修改 .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:// or https:// 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 发布文章使用:只允许注册用户才可以访问!


posted @ 2019-09-18 21:39  xgqfrms  阅读(162)  评论(6编辑  收藏  举报