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() -> SReturn Value
the current configuration of the state
-
Dispatches a
Dispatchableitem. This is the equivalent of theStoreanyDispatch.Declaration
Swift
@discardableResult public func anyDispatch(_ dispatchable: Dispatchable) -> Promise<Any> -
Implementation of the
anyDependenciesrequirement forAnySideEffectContextDeclaration
Swift
public var anyDependencies: SideEffectDependencyContainer { get } -
Implementation of the
getAnyStaterequirement forAnySideEffectContextDeclaration
Swift
public func getAnyState() -> State
View on GitHub
SideEffectContext Structure Reference