Action
-
Action
represents a repeatable work likeSignalProducer
. But on top of the isolation of producedSignal
s from aSignalProducer
,Action
provides higher-order features like availability and mutual exclusion.Similar to a produced
Signal
from aSignalProducer
, each unit of the repreatable work may output zero or more values, and terminate with or without an error at some point.The core of
Action
is theexecute
closure it created with. For every execution attempt with a varying input, if theAction
is enabled, it would request from theexecute
closure a customized unit of work — represented by aSignalProducer
. Specifically, theexecute
closure would be supplied with the latest state ofAction
and the external input fromapply()
.
See moreAction
enforces serial execution, and disables theAction
during the execution.Declaration
Swift
public final class Action<Input, Output, Error> where Error : Error
extension Action: BindingTargetProvider