How to use the @ngrx/store.StoreModule.forRoot function in @ngrx/store

To help you get started, we’ve selected a few @ngrx/store examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gabyx / ExecutionGraph / gui / executionGraphGui / client / apps / eg / src / app / components / graph-open / graph-open.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        MatProgressSpinnerModule, MatIconModule, MatListModule, MatMenuModule, MatDialogModule,
        StoreModule.forRoot(reducers, { initialState: {} })
      ],
      declarations: [GraphOpenComponent, FileBrowserComponent],
      providers: [
        { provide: FileBrowserService, useClass: FileBrowserServiceDummy },
        { provide: LoggerFactory, useClass: SimpleConsoleLoggerFactory },
        { provide: VERBOSE_LOG_TOKEN, useValue: false }
      ]
    }).compileComponents();
  }));
github stefanoslig / angular-ngrx-nx-realworld-example-app / apps / conduit / src / app / +state / app.effects.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [StoreModule.forRoot({})],
      providers: [AppEffects, DataPersistence, provideMockActions(() => actions)]
    });

    effects = TestBed.get(AppEffects);
  });
github devonfw / my-thai-star / angular / src / app / core / authentication / auth-guard.service.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        CoreModule,
        TranslateModule.forRoot(),
        RouterTestingModule,
        EffectsModule.forRoot([]),
        StoreModule.forRoot(fromStore.reducers, {
          runtimeChecks: {
            strictStateImmutability: true,
            strictActionImmutability: true,
          },
        }),
      ],
      providers: [AuthGuardService],
    });
  });
github hasadna / open_pension / client / old-client / src / app / modules / blog / components / detail-post / detail-post.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        SafeHtmlPipe,
        DetailPostComponent,
      ],
      imports: [
        RouterTestingModule,
        StoreModule.forRoot(reducers),
      ],
      providers: [
        { provide: ShareService, useValue: shareButtonsStub },
      ],
      schemas: [ NO_ERRORS_SCHEMA ],
    })
    .compileComponents();
  }));
github SAP / cloud-commerce-spartacus-storefront / src / app / site-context / shared / store / selectors / currencies.selectors.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        StoreModule.forRoot({
          ...fromRoot.reducers,
          siteContext: combineReducers(fromReducers.reducers)
        })
      ]
    });
    store = TestBed.get(Store);
    spyOn(store, 'dispatch').and.callThrough();
  });
github hasadna / open_pension / client / old-client / src / app / modules / contact / components / contact / contact.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ ContactComponent ],
      imports: [
        ReactiveFormsModule,
        StoreModule.forRoot(reducers),
      ],
    })
    .compileComponents();
  }));
github SAP / cloud-commerce-spartacus-storefront / projects / core / src / user / facade / user-interests.service.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        StoreModule.forRoot({}),
        StoreModule.forFeature(USER_FEATURE, fromStoreReducers.getReducers()),
        StoreModule.forFeature(
          PROCESS_FEATURE,
          fromProcessReducers.getReducers()
        ),
      ],
      providers: [UserInterestsService],
    });

    store = TestBed.get(Store as Type>);
    spyOn(store, 'dispatch').and.callThrough();
    service = TestBed.get(UserInterestsService as Type);
  });
github aviabird / angularspree / src / app / app.module.ts View on Github external
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ToastrModule } from 'ngx-toastr';
import { AddressService } from './checkout/address/services/address.service';

@NgModule({
  declarations: [
    AppComponent,
    CheckoutHeaderComponent,
    CheckoutFooterComponent
  ],
  imports: [
    RouterModule.forRoot(routes, {
      preloadingStrategy: AppPreloadingStrategy,
      initialNavigation: 'enabled'
    }),
    StoreModule.forRoot(reducers, { metaReducers, runtimeChecks: { strictStateImmutability: true, strictActionImmutability: true } }),

    /**
     * Store devtools instrument the store retaining past versions of state
     * and recalculating new states. This enables powerful time-travel
     * debugging.
     *
     * To use the debugger, install the Redux Devtools extension for either
     * Chrome or Firefox
     *
     * See: https://github.com/zalmoxisus/redux-devtools-extension
     */
    !environment.production ? StoreDevtoolsModule.instrument() : [],

    /**
     * EffectsModule.forRoot() is imported once in the root module and
     * sets up the effects class to be initialized immediately when the