Contents

CurrentValueSubject

A subject that wraps a single value and publishes a new element whenever the value changes.

Declaration

final class CurrentValueSubject<Output, Failure> where Failure : Error

Mentioned in

Overview

Unlike PassthroughSubject, CurrentValueSubject maintains a buffer of the most recently published element.

Calling send(_:) on a CurrentValueSubject also updates the current value, making it equivalent to updating the value directly.

Topics

Creating a current value subject

Accessing the current value

See Also

Subjects