11online-redux-helpers 中文文档教程
11online Redux Helpers
合并状态和从状态中删除的一些有用的帮助函数。
当前版本仅使用 id
。
像这样导入:import {mergeState, deleteFromState} from '11online-redux-helpers';
在你的 reducer 中这样使用:
case POST_ACTIVITY_SUCCESS:
return {
...state,
isFetching: false,
error: [],
activities: mergeState(state.activities, action.payload)
};
或者
case DELETE_ACTIVITY_SUCCESS:
return {
...state,
isFetching: false,
error: [],
activities: deleteFromState(state.activities, action.payload)
};
11online Redux Helpers
Some helpful helper functions from merging state and deleting from state.
Current version only uses id
.
Import like so: import {mergeState, deleteFromState} from '11online-redux-helpers';
Use like so in your reducer:
case POST_ACTIVITY_SUCCESS:
return {
...state,
isFetching: false,
error: [],
activities: mergeState(state.activities, action.payload)
};
or
case DELETE_ACTIVITY_SUCCESS:
return {
...state,
isFetching: false,
error: [],
activities: deleteFromState(state.activities, action.payload)
};
更多
你可能也喜欢
- 1929asifcsajcdnsvndnvascasm 中文文档教程
- @2003scape/rsc-path-finder 中文文档教程
- @21x37/discord-bot 中文文档教程
- @a-yevgeniev/responsive 中文文档教程
- @aatif-packages/tools 中文文档教程
- @aayushdrolia111/vue-table-component 中文文档教程
- @abaplint/cli 中文文档教程
- @acentswap/aceswap-uikit 中文文档教程
- @acidwave/typeface-marck-script 中文文档教程
- @ackee/redux-utils 中文文档教程