itayod / sync-state-blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MIssing multi property on META_REDUCERS provider

luillyfe opened this issue · comments

I got my app crashed when I was missing multi property for META_REDUCERS provider. Then I read the documentation,

Careful attention should be called to the use of the multi property in the provider here for META_REDUCERS. As this injection token may be utilized by many libraries concurrently, specifying multi: true is critical to ensuring that all library meta reducers are applied to any project that consumes multiple NgRx libraries with registered meta reducers.

But maybe is due to something that in the new version changed, in any case I want to let you know.

{
      provide   : META_REDUCERS,
      deps      : [ROOT_STORAGE_KEYS, ROOT_LOCAL_STORAGE_KEY, LocalStorageService],
      useFactory: getMetaReducers
 },

it should be fixed by adding,

{
      provide   : META_REDUCERS,
      deps      : [ROOT_STORAGE_KEYS, ROOT_LOCAL_STORAGE_KEY, LocalStorageService],
      useFactory: getMetaReducers,
      multi: true
 },