Interface ActionHandler<T, P>

Processes state and makes changes based on the action and / or state. While the ActionHandler is a synchronous function it may have side effects (start asynchronous actions) and can invoke "dispatch" to queue up new actions.

Returns

A tuple, the first element is an object of type T. The optional second element indicates if the state has changed; if not provided it defaults to false.

interface ActionHandler<T, P> ((state, action, dispatch) => [state: T, changed?: boolean])

Type Parameters

  • T

    The type of the state parameter and the first element in the return tuple.

  • P = unknown

    The type of the action's payload property.