Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

v4.0.0

Latest
Compare
Choose a tag to compare
@jverkoey jverkoey released this 27 Apr 05:24

This major release improves the general usage of the observable pattern by removing the
auto-unsubscription behavior from the Subscription type on deallocation.

// Pre-4.0 usage required that you held on to the Subscription instance in order to continue
// receiving values
let subscription = observable.subscribe { value in
  print(value)
}

// 4.0 allows you to subscribe to streams without holding on to the Subscription instance.
observable.subscribe { value in
  print(value)
}

Breaking changes

• Subscriptions no longer unsubscribe automatically upon deallocation.

This means that you no longer need to hold on to a Subscription in order to continue receiving
values from a subscribed stream.

If you were previously depending on this behavior then you must now ensure that you explicitly
unsubscribe from subscriptions.

Source changes

API changes

Auto-generated by running:

apidiff origin/stable release-candidate swift IndefiniteObservable.xcworkspace IndefiniteObservable

Subscription

IndefiniteObservable

modified method: subscribe(observer:) in IndefiniteObservable

Type of change: key.attributes
From: ( { "key.attribute" = "source.decl.attribute.final"; } )
To: ( { "key.attribute" = "source.decl.attribute.final"; }, { "key.attribute" = "source.decl.attribute.discardableResult"; } )

Non-source changes