riducers 1.0.5 → 1.0.6
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.
- package/package.json +1 -1
- package/src/index.ts +1 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -178,6 +178,7 @@ function reducerBuilder(key: string, opts?: ReducerOpts) {
|
|
|
178
178
|
else if (isMap) return mapDeleteReducer(state, {payload, keyName});
|
|
179
179
|
return objDeleteReducer();
|
|
180
180
|
} else if (op === "clear") {
|
|
181
|
+
if (opts && opts?.initialState !== undefined) return opts?.initialState;
|
|
181
182
|
if (isList) return listClearReducer()
|
|
182
183
|
else if (isMap) return mapClearReducer();
|
|
183
184
|
return objClearReducer();
|