StateObserverDispatchable

public protocol StateObserverDispatchable : Dispatchable

Protocol implemented by a dispatchable that wants to be dispatched in response to a change of the state

  • Creates the dispatchable item. If for any reason, the init decides that the dispatchable should not be sent to the Store, the init can fail (that is, returns nil)

    Declaration

    Swift

    init?(prevState: State, currentState: State)

    Parameters

    prevState

    the last state before current changes

    currentState

    the current state

    Return Value

    either the dispatchable item or nil