redux-sacala 0.0.17 → 0.0.18
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/.idea/redux-sacala.iml +1 -0
- package/.idea/webResources.xml +14 -0
- package/package.json +1 -1
- package/src/redux-sacala.spec.ts +3 -2
- package/src/redux-sacala.ts +3 -4
package/.idea/redux-sacala.iml
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
6
6
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
7
7
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
<excludeFolder url="file://$MODULE_DIR$/build" />
|
|
8
9
|
</content>
|
|
9
10
|
<orderEntry type="inheritedJdk" />
|
|
10
11
|
<orderEntry type="sourceFolder" forTests="false" />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="WebResourcesPaths">
|
|
4
|
+
<contentEntries>
|
|
5
|
+
<entry url="file://$PROJECT_DIR$">
|
|
6
|
+
<entryData>
|
|
7
|
+
<resourceRoots>
|
|
8
|
+
<path value="file://$PROJECT_DIR$/src" />
|
|
9
|
+
</resourceRoots>
|
|
10
|
+
</entryData>
|
|
11
|
+
</entry>
|
|
12
|
+
</contentEntries>
|
|
13
|
+
</component>
|
|
14
|
+
</project>
|
package/package.json
CHANGED
package/src/redux-sacala.spec.ts
CHANGED
package/src/redux-sacala.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dispatch, Action, Reducer, Middleware, AnyAction,
|
|
1
|
+
import { Dispatch, Action, Reducer, Middleware, AnyAction, MiddlewareAPI } from "redux";
|
|
2
2
|
|
|
3
3
|
type UnknownToUndefined<T> = unknown extends T ? undefined : T;
|
|
4
4
|
|
|
@@ -89,7 +89,7 @@ export function createReduxBlock<GlobalState, ExtraArgument = undefined>() {
|
|
|
89
89
|
return function applyConfig<
|
|
90
90
|
Name extends (keyof GlobalState) & string,
|
|
91
91
|
Actions extends ActionMap<GlobalState[Name]>,
|
|
92
|
-
Effects extends EffectsMap<GlobalState, ExtraArgument
|
|
92
|
+
Effects extends EffectsMap<GlobalState, ExtraArgument>,
|
|
93
93
|
>({ name, initial, actions, effects }: {
|
|
94
94
|
name: Name;
|
|
95
95
|
initial: GlobalState[Name];
|
|
@@ -98,9 +98,8 @@ export function createReduxBlock<GlobalState, ExtraArgument = undefined>() {
|
|
|
98
98
|
}): {
|
|
99
99
|
name: Name;
|
|
100
100
|
reducer: Reducer<GlobalState[Name]>;
|
|
101
|
-
createMiddleware: MiddlewareCreator<ExtraArgument>;
|
|
102
101
|
actions: ActionCreatorMap<Actions> & EffectsCreatorMap<GlobalState, ExtraArgument, Effects>;
|
|
103
|
-
} {
|
|
102
|
+
} & ({} extends ReturnType<Effects> ? {} : { createMiddleware: MiddlewareCreator<ExtraArgument>; }) {
|
|
104
103
|
const actionCreators = Object.keys(actions).reduce((r, key) => {
|
|
105
104
|
r[key] = createActionCreator(`${name}/${key}`);
|
|
106
105
|
return r;
|