CurrentValueSubject

E427882

CurrentValueSubject is a Combine publisher that maintains and emits a current value to new and existing subscribers in Apple’s reactive programming framework.

All labels observed (1)

Label Occurrences
CurrentValueSubject canonical 2

How this entity was disambiguated

Statements (43)

Predicate Object
instanceOf Combine publisher
class
reference type
category stateful subject
comparedTo PassthroughSubject
completionBehavior after completion no further values are sent
conformsTo Publisher protocol
Subject protocol
constructor init(_ currentValue: Output)
definedIn Combine framework
linked to: Combine
developedBy Apple Inc.
differenceFrom PassthroughSubject does not retain the latest value
documentationURL https://developer.apple.com/documentation/combine/currentvaluesubject
emits current value to new subscribers
subsequent values to existing subscribers
failureTypeConstraint Error
genericParameter Failure
Output
guarantees new subscribers immediately receive current value
hasMethod send(_ value: Output)
send(completion: Subscribers.Completion<Failure>)
send(subscription: Subscription)
subscribe<S>(_ subscriber: S) where S: Subscriber, Failure == S.Failure, Output == S.Input
hasProperty value
introducedIn iOS 13
macOS 10.15
linked to: macOS Catalina

tvOS 13
linked to: tvOS

watchOS 6
linked to: watchOS
lifecycle continues emitting until completion or deallocation
module Combine
ownership value can be read and written via value property
pattern reactive programming
platform Apple platforms
programmingLanguage Swift
propertyType value: Output
publishes synchronous values by default
retains most recently published value
stores current value
subscriptionBehavior each subscriber receives values according to its demand
supports backpressure via Subscription
threadSafety not inherently thread-safe
useCase bridging imperative state into Combine pipelines
exposing mutable state as a publisher

How these facts were elicited

Referenced by (2)

Full triples — surface form annotated when it differs from this entity's canonical label.

Combine providesType CurrentValueSubject
PassthroughSubject relatedTo CurrentValueSubject