Skip to content

Commit e1933eb

Browse files
committed
Adds deprecation explanation for Variable. ReactiveX#1501
1 parent 0edb1e1 commit e1933eb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

RxSwift/Deprecated.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ extension ObservableType {
156156
///
157157
/// Unlike `BehaviorSubject` it can't terminate with error, and when variable is deallocated
158158
/// it will complete its observable sequence (`asObservable`).
159+
///
160+
/// **This concept will be deprecated from RxSwift but offical migration path hasn't been decided yet.**
161+
/// https://github.com/ReactiveX/RxSwift/issues/1501
162+
///
163+
/// Current recommended replacement for this API is `RxCocoa.BehaviorRelay` because:
164+
/// * `Variable` isn't a standard cross platform concept, hence it's out of place in RxSwift target.
165+
/// * It doesn't have a counterpart for handling events (`PublishRelay`). It models state only.
166+
/// * It doesn't have a consistent naming with *Relay or other Rx concepts.
167+
/// * It has an inconsistent memory management model compared to other parts of RxSwift (completes on `deinit`).
168+
///
169+
/// Once plans are finalized, official availability attribute will be added in one of upcoming versions.
159170
public final class Variable<Element> {
160171

161172
public typealias E = Element

0 commit comments

Comments
 (0)