@angular-redux/store
Options
All
  • Public
  • Public/Protected
  • All
Menu

Convenience mock to make it easier to control selector behaviour in unit tests.

Hierarchy

Implements

Index

Properties

configureSubStore

configureSubStore: configureSubStore = this.mockRootStore.configureSubStore

dispatch

dispatch: Dispatch<any> = this.mockRootStore.dispatch as Dispatch<any>

getState

getState: (Anonymous function) = this.mockRootStore.getState

replaceReducer

replaceReducer: replaceReducer = this.mockRootStore.replaceReducer

select

select: (Anonymous function) = this.mockRootStore.select

subscribe

subscribe: subscribe = this.mockRootStore.subscribe

Static Optional mockInstance

mockInstance: MockNgRedux = undefined
deprecated

Use MockNgRedux.getInstance() instead.

Methods

configureStore

  • configureStore(rootReducer: Reducer<any>, initState: any, middleware?: Middleware[], enhancers?: StoreEnhancer<any>[]): void

provideStore

  • provideStore(store: Store<any>): void

Static getInstance

Static getSelectorStub

  • Returns a subject that's connected to any observable returned by the given selector. You can use this subject to pump values into your components or services under test; when they call .select or @select in the context of a unit test, MockNgRedux will give them the values you pushed onto your stub.

    Type parameters

    • R

    • S

    Parameters

    Returns Subject<S>

Static getSubStore

  • getSubStore<S>(...pathSelectors: PathSelector[]): MockObservableStore<S>
  • Returns a mock substore that allows you to set up selectorStubs for any 'fractal' stores your app creates with NgRedux.configureSubStore.

    If your app creates deeply nested substores from other substores, pass the chain of pathSelectors in as ordered arguments to mock the nested substores out.

    Type parameters

    • S

    Parameters

    Returns MockObservableStore<S>

Static reset

  • reset(): void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc