Adjust MotionObservable subscription APIs to encourage forwarding channels rather than creating a terminal subscription.

Authored by featherless on Mar 13 2017, 4:53 PM.



The short-form subscribe(next:) method causes a stream to terminate its channels. This can be problematic for operators that are expected to pass along their core animation and visualization channels.

This diff adjusts the APIs to encourage passing the observer along with subscribe when relevant, and to use _subscribe when a terminal subscription is intentionally being created.

We want to discourage use of _subscribe in app space, so I've prefixed the API with a _ to indicate that fact.

Diff Detail

rREACTIVEMOTIONSWIFT reactive-motion-swift
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
featherless created this revision.Mar 13 2017, 4:53 PM
chuga accepted this revision.Mar 13 2017, 5:20 PM
chuga added a subscriber: chuga.
chuga added inline comments.

I'm wondering if naming this something like _subscribeToNext or _subscribeToNextOnly would better convey what this is doing and the difference with subscribe(observer).
Just a suggestion.

This revision is now accepted and ready to land.Mar 13 2017, 5:20 PM
This revision was automatically updated to reflect the committed changes.