雷德克斯·唐克斯特(Redux Thunkster) :telescope: ·
Redux中间件,用于观察动作并根据观察到的内容调度新动作。
安装方式
npm install --save thunkster
用法
const { createStore , applyMiddleware } = require ( 'redux' ) ;
const thunkster = require ( 'thunkster' ) ;
// Sample root reducer
const reducer = ( state = { } , action ) => {
return {
... state ,
... action . payload ,
} ;
} ;
// Create Redux store
const store = createStore ( reducer
评论0
最新资源