['products/query']: function*() {
yield call(delay(800));
yield put({
type: 'products/query/success',
payload: ['ant-tool', 'roof'],
});
},
1.构造器这边的['products/query']:
不理解,arr当字面量的key吗
['products/query'](state) {
return { ...state, loading: true, };
},
['xxx'](bb){}
不理解啥语法糖
第一个就是'products/query'的意思 []里面可以放变量现在是常量就没有意思
第二个就是方法名 因为方法名不能取xxx/xxx 当然你调用的时候也要xxx['xxx/xxx']