Odonno / ngrx-signalr-core

A library to handle realtime SignalR (.NET Core) events using @angular, rxjs and the @ngrx library
https://www.npmjs.com/package/ngrx-signalr-core
MIT License
28 stars 13 forks source link

Can't add reducer to app.module #2

Closed Gadziu1 closed 4 years ago

Gadziu1 commented 4 years ago

I keep all reducers in one const

export const reducers: ActionReducerMap<AppState, any> = {
  router: routerReducer,
  projects: Projects.projectsReducer,
  signalr: signalrReducer
};

In app.module I have

imports: [
    StoreModule.forRoot<AppState, any>(reducers, {
      metaReducers,
      runtimeChecks: {
        strictStateImmutability: true,
        strictActionImmutability: true
      },
    }),

And I got error

Type '{ router: (state: RouterReducerState | undefined, action: Action) => RouterReducerState; projects: (state: State | undefined, action: Action) => State; ... 6 more ...; signalr: (state: BaseSignalRStoreState | undefined, action: Action) => BaseSign...' is not assignable to type 'ActionReducerMap<AppState, any>'. Object literal may only specify known properties, and 'signalr' does not exist in type 'ActionReducerMap<AppState, any>'.ts(232

Gadziu1 commented 4 years ago

I found solutions it was missing in my app.reducers files

export interface AppState {
  signalr: BaseSignalRStoreState;
}