Last active
February 16, 2016 19:18
Revisions
-
bclymer revised this gist
Feb 16, 2016 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,12 @@ import rx.Observable data class TestUser(val name: String) fun getTestUser(): Observable<TestUser> { return Observable.just(TestUser("Brian")).flatMap { getUser() } // this compiles } fun getTestUser2(): Observable<TestUser> { val observable = Observable.just(TestUser("Brian")).flatMap { getUser() } return observable // this does not compile } fun getUser(): Observable<TestUser?> { -
bclymer revised this gist
Feb 16, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,5 +7,5 @@ fun getTestUser(): Observable<TestUser> { } fun getUser(): Observable<TestUser?> { return Observable.just(null) } -
bclymer created this gist
Feb 16, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ import rx.Observable data class TestUser(val name: String) fun getTestUser(): Observable<TestUser> { return Observable.just(TestUser("Brian")).flatMap { getUser() } } fun getUser(): Observable<TestUser?> { return Observable.empty() }