angular ngrx-store-localstorage don't stored data after reload

You need to add rehydrate key to the localStorageSync function call.

export function localStorageSyncReducer(reducer: ActionReducer<any>): ActionReducer<any> {
  return localStorageSync(
     {keys: ['authentication'],
      rehydrate: true})(reducer);
}

See: https://github.com/btroncone/ngrx-store-localstorage/blob/master/README.md for details.


What you need is just add an option of rehydrate boolean set as true in your app.module file.

This will pull or fetch the data from localStorage in to your reducer's initial state while reloading.

Your localStorageSync should be configured as...

localStorageSync(
 {keys: ['authentication'],
  rehydrate: true     <------ add this line
}) (reducer);