Signal
-
A push-driven stream that sends Events over time, parameterized by the type of values being sent (
Value
) and the type of failure that can occur (Error
). If no failures should be possible, Never can be specified forError
.An observer of a Signal will see the exact same sequence of events as all other observers. In other words, events will be sent to all observers at the same time.
Signals are generally used to represent event streams that are already “in progress,” like notifications, user input, etc. To represent streams that must first be started, see the SignalProducer type.
A Signal is kept alive until either of the following happens:
- its input observer receives a terminating event; or
- it has no active observers, and is not being retained.
Declaration
Swift
public final class Signal<Value, Error> where Error : Error
extension Signal: SignalProtocol
extension Signal: SignalProducerConvertible
extension Signal: BindingSource where Error == Never
-
Describes how a stream of inner streams should be flattened into a stream of values.
See moreDeclaration
Swift
public struct FlattenStrategy