ngrx-store-localstorage icon indicating copy to clipboard operation
ngrx-store-localstorage copied to clipboard

Angular 17 Standalone Components

Open SebasGonza opened this issue 1 year ago • 1 comments

How can i implement this library in angular 17 with standalone components?

SebasGonza avatar Feb 28 '24 15:02 SebasGonza

You can do it by yourself like this :

const localStorageSyncReducer = (reducer: ActionReducer<unknown>): ActionReducer<unknown> => localStorageSync(config)(reducer);
const metaReducers: Array<MetaReducer<any, any>> = [localStorageSyncReducer];
const storeModule = StoreModule.forRoot(reducers, { metaReducers });

bootstrapApplication(AppComponent, {
      providers: [...(storeModule.providers ?? [])]
});

gartu avatar Apr 17 '24 14:04 gartu