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 configuraiton of the state

    Declaration

    Swift

    func getAnyState() -> State

    Return Value

    the type erased current configuration of the state

  • Dispatches a new item

    Declaration

    Swift

    @discardableResult
    func dispatch(_ dispatchable: Dispatchable) -> Promise<Void>

    Parameters

    dispatchable

    the item to dispatch

    Return Value

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

  • awaitDispatch(_:) Extension method

    Dispatches an item and wait for the related promise to be resolved. This is a shortcut for try await(dispatch(item)).

    Declaration

    Swift

    func awaitDispatch(_ dispatchable: Dispatchable) throws

    Parameters

    dispatchable

    the item to dispatch