ActionTemplate
public struct ActionTemplate<Payload>
A template for creating Action
s.
The template can have a Payload
type which is used when creating an actual Action
from the template.
-
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 givenpayloadType
.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 theActionTemplate
sid
and the givenpayload
.Declaration
Swift
public func createAction(payload: Payload) -> AnonymousAction<Payload>
Parameters
payload
The payload to create the
AnonymousAction
with -
Creates an
AnonymousAction
with theActionTemplate
sid
and the givenpayload
.Declaration
Swift
public func callAsFunction(payload: Payload) -> AnonymousAction<Payload>
Parameters
payload
The payload to create the
AnonymousAction
with
-
Initializes an
ActionTemplate
with noPayload
.Declaration
Swift
init(id: String)
Parameters
id
The identifier for the
ActionTemplate
-
Creates an
AnonymousAction
with theActionTemplate
sid
.Declaration
Swift
func createAction() -> AnonymousAction<Payload>
-
Creates an
AnonymousAction
with theActionTemplate
sid
.Declaration
Swift
func callAsFunction() -> AnonymousAction<Payload>