Created
July 4, 2018 09:07
-
-
Save onmyway133/b22e3e229a487b01ebe771eb43bd65f7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class ViewModel { | |
let friends: Observable<[User]> | |
init() { | |
let client = APIClient() | |
friends = Observable<[User]>.create({ subscriber in | |
client.getFacebookFriends(completion: { friends in | |
subscriber.onNext(friends) | |
subscriber.onCompleted() | |
}) | |
return Disposables.create() | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment