Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(router-store): Make usage of forRoot required (#1662)
BREAKING CHANGES: usage of forRoot is now required for StoreRouterConnectionModule BEFORE: @NgModule({ providers: [ { provide: _ROUTER_CONFIG, useValue: {}, }, { provide: ROUTER_CONFIG, useFactory: _createRouterConfig, deps: [_ROUTER_CONFIG], }, { provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer, }, ], }) export class StoreRouterConnectingModule { static forRoot< T extends BaseRouterStoreState = SerializedRouterStateSnapshot >( config: StoreRouterConfig<T> = {} ): ModuleWithProviders<StoreRouterConnectingModule> { return { ngModule: StoreRouterConnectingModule, providers: [ { provide: _ROUTER_CONFIG, useValue: config }, { provide: RouterStateSerializer, useClass: config.serializer ? config.serializer : DefaultRouterStateSerializer, }, ], }; } AFTER: @NgModule() export class StoreRouterConnectingModule { static forRoot< T extends BaseRouterStoreState = SerializedRouterStateSnapshot >( config: StoreRouterConfig<T> = {} ): ModuleWithProviders<StoreRouterConnectingModule> { return { ngModule: StoreRouterConnectingModule, providers: [ { provide: _ROUTER_CONFIG, useValue: config }, { provide: ROUTER_CONFIG, useFactory: _createRouterConfig, deps: [_ROUTER_CONFIG], }, { provide: RouterStateSerializer, useClass: config.serializer ? config.serializer : DefaultRouterStateSerializer, }, ], }; }
- Loading branch information