Skip to content

Commit

Permalink
fix(Store): Use existing reducers when providing reducers without an …
Browse files Browse the repository at this point in the history
…InjectionToken (#254)

Closes #250, related to #116
  • Loading branch information
brandonroberts authored and MikeRyanDev committed Aug 9, 2017
1 parent 0fc1bcc commit c409252
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/store/src/store_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ export class StoreModule {
deps: [_INITIAL_STATE],
},
{ provide: _INITIAL_REDUCERS, useValue: reducers },
reducers instanceof InjectionToken
? [{ provide: _STORE_REDUCERS, useExisting: reducers }]
: [],
{
provide: _STORE_REDUCERS,
useExisting:
reducers instanceof InjectionToken ? reducers : _INITIAL_REDUCERS,
},
{
provide: INITIAL_REDUCERS,
deps: [
Expand Down

0 comments on commit c409252

Please sign in to comment.