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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redux-sacala",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "author": {
5
5
  "name": "Andrey Monkin",
6
6
  "email": "monkin.andrey@gmail.com"
@@ -1,5 +1,4 @@
1
1
  import {
2
- Store,
3
2
  createStore,
4
3
  combineReducers,
5
4
  applyMiddleware,
@@ -31,7 +30,9 @@ const {
31
30
  },
32
31
  effects: (dispatch, getState) => {
33
32
  return {
34
-
33
+ incEffect() {
34
+ dispatch(local.inc());
35
+ }
35
36
  };
36
37
  }
37
38
  });
@@ -1,4 +1,4 @@
1
- import { Dispatch, Action, Reducer, Middleware, AnyAction, Store, MiddlewareAPI } from "redux";
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;