SideEffectContext
public struct SideEffectContext<S, D> where S : State, D : SideEffectDependencyContainer
extension SideEffectContext: AnySideEffectContext
Context passed to each side effect.
The context is basically a wrapper of methods and utilities that the side effect can leverage to implement its functionalities
-
The dependencies passed to the
Store
. You can use this as a mechanism for dependencies injection.Declaration
Swift
public let dependencies: D
-
Function that returns the current configuration of the state
Declaration
Swift
public func getState() -> S
Return Value
the current configuration of the state
-
Dispatches a
Dispatchable
item. This is the equivalent of theStore
anyDispatch
.Declaration
Swift
@discardableResult public func anyDispatch(_ dispatchable: Dispatchable) -> Promise<Any>
-
Implementation of the
anyDependencies
requirement forAnySideEffectContext
Declaration
Swift
public var anyDependencies: SideEffectDependencyContainer { get }
-
Implementation of the
getAnyState
requirement forAnySideEffectContext
Declaration
Swift
public func getAnyState() -> State