@react-pakistan/util-functions 1.25.55 → 1.25.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -32,6 +32,7 @@ export declare const GENERIC_ACTION_TYPES: {
|
|
|
32
32
|
readonly SET_DISABLE_SAVE_BUTTON: "SET_DISABLE_SAVE_BUTTON";
|
|
33
33
|
readonly SET_INPUT_FIELD: "SET_INPUT_FIELD";
|
|
34
34
|
readonly SET_ERRORS: "SET_ERRORS";
|
|
35
|
+
readonly SET_FILTERS: "SET_FILTERS";
|
|
35
36
|
};
|
|
36
37
|
export declare const createGenericReducer: <T>(config: ModuleConfig<T>) => (state: T, action: any) => T;
|
|
37
38
|
export declare const createGenericModuleHook: <T>(config: ModuleConfig<T>) => () => GenericModuleContext<T>;
|
|
@@ -60,6 +61,7 @@ export declare const createGenericModule: <T>(config: ModuleConfig<T>) => {
|
|
|
60
61
|
readonly SET_DISABLE_SAVE_BUTTON: "SET_DISABLE_SAVE_BUTTON";
|
|
61
62
|
readonly SET_INPUT_FIELD: "SET_INPUT_FIELD";
|
|
62
63
|
readonly SET_ERRORS: "SET_ERRORS";
|
|
64
|
+
readonly SET_FILTERS: "SET_FILTERS";
|
|
63
65
|
};
|
|
64
66
|
initialState: T;
|
|
65
67
|
};
|
|
@@ -67,6 +67,7 @@ exports.GENERIC_ACTION_TYPES = {
|
|
|
67
67
|
SET_DISABLE_SAVE_BUTTON: 'SET_DISABLE_SAVE_BUTTON',
|
|
68
68
|
SET_INPUT_FIELD: 'SET_INPUT_FIELD',
|
|
69
69
|
SET_ERRORS: 'SET_ERRORS',
|
|
70
|
+
SET_FILTERS: 'SET_FILTERS',
|
|
70
71
|
};
|
|
71
72
|
// ============================================================================
|
|
72
73
|
// GENERIC REDUCER FACTORY
|
|
@@ -97,6 +98,8 @@ var createGenericReducer = function (config) {
|
|
|
97
98
|
return __assign(__assign({}, state), (_a = {}, _a[action.payload.key] = action.payload.value, _a));
|
|
98
99
|
case exports.GENERIC_ACTION_TYPES.SET_ERRORS:
|
|
99
100
|
return __assign(__assign({}, state), { errors: action.payload.errors });
|
|
101
|
+
case exports.GENERIC_ACTION_TYPES.SET_FILTERS:
|
|
102
|
+
return __assign(__assign({}, state), action.payload.filters);
|
|
100
103
|
default:
|
|
101
104
|
return state;
|
|
102
105
|
}
|