ActionTemplate

public struct ActionTemplate<Payload>

A template for creating Actions.

The template can have a Payloadtype which is used when creating an actual Action from the template.

  • id

    The identifier for the ActionTemplate

    Declaration

    Swift

    public let id: String
  • The type of the Payload

    Declaration

    Swift

    public let payloadType: Payload.Type
  • Initializes an ActionTemplate with the given payloadType.

    Declaration

    Swift

    public init(id: String, payloadType: Payload.Type)

    Parameters

    id

    The identifier for the ActionTemplate

    payloadType

    The type of the Payload

  • Creates an AnonymousAction with the ActionTemplates id and the given payload.

    Declaration

    Swift

    public func createAction(payload: Payload) -> AnonymousAction<Payload>

    Parameters

    payload

    The payload to create the AnonymousAction with

  • Creates an AnonymousAction with the ActionTemplates id and the given payload.

    Declaration

    Swift

    public func callAsFunction(payload: Payload) -> AnonymousAction<Payload>

    Parameters

    payload

    The payload to create the AnonymousAction with

Available where Payload == Void