This repository has been archived by the owner on Oct 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make IndefiniteObservable observer-agnostic.
Summary: IndefiniteObservable now makes no assumptions about the type of observer it can hold. Instead, a client is expected to subclass IndefiniteObservable and scope the Observer type accordingly: For example, this is a single-channel ValueObserver: ``` public final class ValueObserver<T> { public typealias Value = T public init(_ next: @escaping (T) -> Void) { self.next = next } public let next: (T) -> Void } public class ValueObservable<T>: IndefiniteObservable<ValueObserver<T>> { public final func subscribe(_ next: @escaping (T) -> Void) -> Subscription { return super.subscribe(observer: ValueObserver(next)) } } ``` Reviewers: O4 Material Motion Apple platform reviewers, O2 Material Motion, markwei Reviewed By: O4 Material Motion Apple platform reviewers, O2 Material Motion, markwei Subscribers: markwei Tags: #material_motion Differential Revision: http://codereview.cc/D2116
- Loading branch information
Jeff Verkoeyen
committed
Dec 6, 2016
1 parent
0a63084
commit 8c30e9a
Showing
6 changed files
with
125 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.