AnySideEffectContext

public protocol AnySideEffectContext

Type erasure for SideEffectContext

  • Type erased dependencies of the side effect

    Declaration

    Swift

    var anyDependencies: SideEffectDependencyContainer { get }
  • Type erased function that returns the current configuration of the state

    Declaration

    Swift

    func getAnyState() -> State

    Return Value

    the type erased current configuration of the state

  • Dispatches a Dispatchable. It will essentially call the anyDispatch method of the backing store.

    Declaration

    Swift

    @discardableResult
    func anyDispatch(_ dispatchable: Dispatchable) -> Promise<Any>

    Parameters

    dispatchable

    the item to dispatch

    Return Value

    a promise that is resolved when the store finishes handling the dispatched item

  • dispatch(_:) Default implementation

    Dispatches a AnySideEffect.

    Default Implementation

    Default implementation of the dispatch<T: ReturningSideEffect>

    Declaration

    Swift

    @discardableResult
    func dispatch<T>(_ dispatchable: T) -> Promise<Void> where T : AnySideEffect

    Parameters

    dispatchable

    the AnySideEffect to dispatch

    Return Value

    a promise that is resolved with the value returned by the side effect when the store finishes handling the dispatched item

  • Dispatches a AnyStateUpdater.

    Declaration

    Swift

    @discardableResult
    func dispatch<T>(_ dispatchable: T) -> Promise<Void> where T : AnyStateUpdater

    Parameters

    dispatchable

    the side effect to dispatch

    Return Value

    a promise that is resolved when the store finishes updating the state

  • Dispatches a ReturningSideEffect

    Declaration

    Swift

    @discardableResult
    func dispatch<T>(_ dispatchable: T) -> Promise<T.ReturnValue> where T : ReturningSideEffect

    Parameters

    dispatchable

    the ReturningSideEffect to dispatch

    Return Value

    a promise that is resolved with the value returned by the side effect when the store finishes handling the dispatched item