Skip to content

Commit

Permalink
fix(store): forFeature using instanceof instead of typeof (#2922)
Browse files Browse the repository at this point in the history
Closes #2919
  • Loading branch information
timdeschryver authored Feb 12, 2021
1 parent 775c794 commit 2bea205
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/store/src/store_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,16 @@ export class StoreModule {
{
provide: _FEATURE_CONFIGS,
multi: true,
useValue: typeof featureNameOrSlice === 'string' ? config : {},
useValue: featureNameOrSlice instanceof Object ? {} : config,
},
{
provide: STORE_FEATURES,
multi: true,
useValue: {
key:
typeof featureNameOrSlice === 'string'
? featureNameOrSlice
: featureNameOrSlice.name,
featureNameOrSlice instanceof Object
? featureNameOrSlice.name
: featureNameOrSlice,
reducerFactory:
!(config instanceof InjectionToken) && config.reducerFactory
? config.reducerFactory
Expand All @@ -254,9 +254,9 @@ export class StoreModule {
provide: _FEATURE_REDUCERS,
multi: true,
useValue:
typeof featureNameOrSlice === 'string'
? reducersOrConfig
: featureNameOrSlice.reducer,
featureNameOrSlice instanceof Object
? featureNameOrSlice.reducer
: reducersOrConfig,
},
{
provide: _FEATURE_REDUCERS_TOKEN,
Expand Down

0 comments on commit 2bea205

Please sign in to comment.