Connectable

public protocol Connectable

Makes a view “connectable” to the application state.

This should not be used directly. Instead, use ConnectableView. This protocol isn’t combined into ConnectableView due to a possible bug in Swift that throws an invalid assocated type if Props isn’t explicitly typealiased.

  • Undocumented

    Declaration

    Swift

    associatedtype State
  • Undocumented

    Declaration

    Swift

    associatedtype Props : Equatable
  • map(state:) Default implementation

    Map a superstate to the state needed by the view using the provided parameter.

    The method can return nil until the state becomes available. While it is nil, the view will not be rendered.

    Default Implementation

    Default implementation. Returns nil.

    Declaration

    Swift

    func map(state: State) -> Props?

    Parameters

    state

    The superstate provided to the view from a superview.

    Return Value

    The state if possible.

  • map(state:binder:) Default implementation

    Map a superstate to the state needed by the view using the provided parameter.

    The method can return nil until the state becomes available. While it is nil, the view will not be rendered.

    Default Implementation

    Default implementation. Calls the other map function.

    Declaration

    Swift

    func map(state: State, binder: ActionBinder) -> Props?

    Parameters

    state

    The superstate provided to the view from a superview.

    binder

    Helper that creates Binding types beteen the state and a dispatcable action

    Return Value

    The state if possible.