@@ -6,6 +6,11 @@
import {CLEAR_LIST_STATE, LIST_STATE} from "../constants/actionTypes";
import store from '../store/store'
+/**
+ * 保存列表状态
+ * @param data
+ * @returns {Function}
+ */
export const saveListState = (data) => {
return () => {
store.dispatch({
@@ -15,6 +20,10 @@ export const saveListState = (data) => {
}
+ * 清除列表状态
export const clearListState = () => {
@@ -20,11 +20,13 @@ const redListState = (state = initListState, action) => {
switch (action.type) {
case LIST_STATE:
+ //更新列表状态
return {
...state,
...action
case CLEAR_LIST_STATE:
+ //清空列表状态
return initListState
default:
return state