Skip to content

Commit

Permalink
fix(api): Add store to addSideEffects
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostap Chervak committed Nov 23, 2017
1 parent fe4c299 commit 4cab409
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/state-lib/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export interface PoaSideEffectOpts {
actions: any;
router: History;
env: any;
store: any;
}

export declare type PoaSideEffectFunction<T extends ActionMessage> = (
Expand All @@ -100,7 +101,12 @@ export function addSideEffects<T extends ActionMessage>(
target: PoaSideEffectFunction<T>
): OrchestratorFunction<T> {
return orchestrator(actionCreator, actionMessage => {
return target(actionMessage, { actions: getActions(), router: getHistory(), env: getEnv() });
return target(actionMessage, {
actions: getActions(),
router: getHistory(),
env: getEnv(),
store: getStore()
});
});
}

Expand Down

0 comments on commit 4cab409

Please sign in to comment.