Action
-
Actionrepresents a repeatable work likeSignalProducer. But on top of the isolation of producedSignals from aSignalProducer,Actionprovides higher-order features like availability and mutual exclusion.Similar to a produced
Signalfrom 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
Actionis theexecuteclosure it created with. For every execution attempt with a varying input, if theActionis enabled, it would request from theexecuteclosure a customized unit of work — represented by aSignalProducer. Specifically, theexecuteclosure would be supplied with the latest state ofActionand the external input fromapply().
See moreActionenforces serial execution, and disables theActionduring the execution.Declaration
Swift
public final class Action<Input, Output, Error> where Error : Errorextension Action: BindingTargetProvider
View on GitHub
Install in Dash
Action Reference