Skip to content

STRUCT

StateMutationSink¶

public struct StateMutationSink<WorkflowType: Workflow>

StateMutationSink provides a Sink that helps mutate State using it’s KeyPath.

Methods¶

send(_:)¶

public func send(_ update: @escaping (inout WorkflowType.State) -> Void)

Sends message to StateMutationSink to update State’s value using the provided closure.

  • Parameters:
  • update: The State mutation to perform.

Parameters¶

Name Description
update The State mutation to perform.

send(_:value:)¶

public func send<Value>(_ keyPath: WritableKeyPath<WorkflowType.State, Value>, value: Value)

Sends message to StateMutationSink to update State’s value at KeyPath with Value.

  • Parameters:
  • keyPath: Key path of State whose value needs to be mutated.
  • value: Value to update State with.

Parameters¶

Name Description
keyPath Key path of State whose value needs to be mutated.
value Value to update State with.