Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface StoreDispatcher<S>

Type parameters

  • S

Hierarchy

  • Store<S>
    • StoreDispatcher

Implemented by

Index

Methods

action

actionByType

actions

  • actions<A>(): Observable<Event<A>>
  • Type parameters

    • A

    Returns Observable<Event<A>>

    an observable of all the action emitted on the store

dispatch

  • dispatch<A>(action: A): any
  • trigger an action on the store that may then trigger reducer, the action will propagate to parent store

    Type parameters

    • A

    Parameters

    • action: A

      the action to trigger

    Returns any

dispatchWithSource

  • dispatchWithSource<A>(action: A, source: string): any
  • Type parameters

    • A

    Parameters

    • action: A
    • source: string

    Returns any

map

  • map<T>(path: string): Store<T>
  • create a view on the substate designed by the path

    Type parameters

    • T

    Parameters

    • path: string

      to the substate

    Returns Store<T>

    a view store on 'path' substate

mapFunction

  • mapFunction<T>(id: string, map: function, mapReverse: function): Store<T>
  • create a view on the store pointing of a substate extracted by the @param mapFunction function

    Type parameters

    • T

    Parameters

    • id: string
    • map: function

      function to extract the substate the view will be based on

        • (s: S): T
        • Parameters

          • s: S

          Returns T

    • mapReverse: function

      mapFunction function to reinject the substate in the parent state, this is used when the substate is updated

        • (state: T, parentState: S): S
        • Parameters

          • state: T
          • parentState: S

          Returns S

    Returns Store<T>

    a view store on the substate

observable

  • observable(): Observable<S>
  • Returns Observable<S>

    an observable with the store state will be trigger when the state is updated

subscribe

  • subscribe<A>(actions: Observable<A>, reducer: function): void
  • directly subscribe a reducer on an observable

    Type parameters

    • A

    Parameters

    • actions: Observable<A>

      the observable the reducer will subscribe

    • reducer: function

      function

        • (s: S, a: A): S
        • Parameters

          • s: S
          • a: A

          Returns S

    Returns void

subscribeEvent

  • subscribeEvent<A>(actions: Observable<Event<A>>, reducer: function): void
  • directly subscribe a reducer on an observable

    Type parameters

    • A

    Parameters

    • actions: Observable<Event<A>>

      the observable the reducer will subscribe

    • reducer: function

      function

        • (s: S, a: A): S
        • Parameters

          • s: S
          • a: A

          Returns S

    Returns void

subscribeReducer

  • subscribeReducer<A>(actions: Observable<A>, reducer: Reducer<S, A>): void
  • directly subscribe a reducer on an observable

    Type parameters

    • A

    Parameters

    • actions: Observable<A>

      the observable the reducer will subscribe

    • reducer: Reducer<S, A>

      object

    Returns void

subscribeReducerEvent

  • subscribeReducerEvent<A>(actions: Observable<Event<A>>, reducer: Reducer<S, A>): void
  • directly subscribe a reducer on an observable

    Type parameters

    • A

    Parameters

    • actions: Observable<Event<A>>

      the observable the reducer will subscribe

    • reducer: Reducer<S, A>

      object

    Returns void

Generated using TypeDoc