DispatchObserverDispatchable

public protocol DispatchObserverDispatchable : Dispatchable

Protocol implemented by a dispatchable that wants to be dispatched in response to the dispatch of another dispatchable

  • 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?(dispatchedItem: Dispatchable, prevState: State, currentState: State)

    Parameters

    dispatchedItem

    the item that triggered the init

    prevState

    the last state before current changes

    currentState

    the current state

    Return Value

    either the dispatchable item or nil