Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RootReducer<TState>

Type parameters

  • TState

Hierarchy

Implements

Index

Constructors

constructor

  • new RootReducer(initState?: Partial<TState>): RootReducer

Properties

Protected _name

_name: string

Accessors

name

  • get name(): string

path

  • get path(): string

Methods

join

  • Join subreducer to another. If subreducer with same name already joined, it will be unjoined before joining new.

    Type parameters

    • T: TReducerState[keyof TReducerState]

    Parameters

    Returns this

joinListener

  • joinListener(name: string, handler: function): this
  • Parameters

    • name: string
    • handler: function
        • (state: TState, action: any): void
        • Parameters

          • state: TState
          • action: any

          Returns void

    Returns this

joinReducer

  • joinReducer<T>(name: keyof TState, reducer: function): this
  • Type parameters

    • T: TReducerState[keyof TReducerState]

    Parameters

    • name: keyof TState
    • reducer: function
        • (state: T, action: any): T
        • Parameters

          • state: T
          • action: any

          Returns T

    Returns this

on

reducer

  • reducer(state: TReducerState, action: A): any
  • Reducer function that reduce given state with action and returns new state. Also call each subscribers handler. If current state is function, call it with action as first argument and returns result. If current state and initState not a object (example string or number) pass state to ActionReducer and returns result. If current state is object reduce all joined ISubReducer (reducers) after pass state to ActionReducer and returns result.

    Parameters

    • state: TReducerState
    • action: A

    Returns any

setParent

stateSelector

  • stateSelector(state: any): any

Generated using TypeDoc