StoreT

public final class StoreT<S, W, A> : StoreTOf<S, W, A>

The Store Comonad Transformer. This Comonad Transformer extends the context of a value in the base Comonad so that it depends on a position of the type of the state.

  • Rendering function in the context of the base Comonad.

    Declaration

    Swift

    public let render: Kind<W, (S) -> A>
  • Current focus of this Store.

    Declaration

    Swift

    public let state: S
  • Safe downcast.

    Declaration

    Swift

    public static func fix(_ value: StoreTOf<S, W, A>) -> StoreT<S, W, A>

    Parameters

    value

    Value in the higher-kind form.

    Return Value

    Value cast to StoreT.

  • Initializes a StoreT.

    Declaration

    Swift

    public init(_ state: S, _ render: Kind<W, (S) -> A>)

    Parameters

    state

    Current focus of the Store.

    render

    Rendering function of the Store.

  • Moves the store into a new state.

    Declaration

    Swift

    func move(_ newState: S) -> StoreT<S, W, A>

    Parameters

    newState

    New state for the store.

    Return Value

    A new store focused on the provided state.

  • Initializes a Store.

    Declaration

    Swift

    public convenience init(_ state: S, _ render: @escaping (S) -> A)

    Parameters

    state

    Current focus of the store.

    render

    Rendering function.