Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ViewStore<S, P>

Type parameters

  • S

  • P

Hierarchy

  • ViewStore

Implements

Index

Constructors

constructor

  • Parameters

    • id: string
    • mapFunc: function
        • (s: P): S
        • Parameters

          • s: P

          Returns S

    • mapReverseFunction: function
        • (state: S, parentState: P): P
        • Parameters

          • state: S
          • parentState: P

          Returns P

    • store: StoreDispatcher<P>

    Returns ViewStore

Properties

Private id

id: string

Private mapFunc

mapFunc: function

Type declaration

    • (s: P): S
    • Parameters

      • s: P

      Returns S

Private mapReverseFunction

mapReverseFunction: function

Type declaration

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

      • state: S
      • parentState: P

      Returns P

Private store

store: StoreDispatcher<P>

Methods

action

actionByType

actions

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

dispatch

  • dispatch<A>(action: A): void

dispatchWithSource

  • dispatchWithSource<A>(action: A, source: string): void

map

  • map<T>(path: string): Store<T>

mapFunction

  • mapFunction<T>(id: string, map: function, mapReverse: function): Store<T>
  • Type parameters

    • T

    Parameters

    • id: string
    • map: function
        • (s: S): T
        • Parameters

          • s: S

          Returns T

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

          • state: T
          • parentState: S

          Returns S

    Returns Store<T>

observable

  • observable(): Observable<S>

subscribe

  • subscribe<A>(actions: Observable<A>, reducer: function): void
  • Type parameters

    • A

    Parameters

    • actions: Observable<A>
    • reducer: 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
  • Type parameters

    • A

    Parameters

    • actions: Observable<Event<A>>
    • reducer: 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

subscribeReducerEvent

  • subscribeReducerEvent<A>(actions: Observable<Event<A>>, reducer: Reducer<S, A>): void

Generated using TypeDoc