Last active
July 31, 2018 11:32
-
-
Save JorgeCastilloPrz/c5ca918c765f9176a68caa8471ebdd71 to your computer and use it in GitHub Desktop.
allTasksByUserAsync.kt
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
override fun allTasksByUser(user: User): Kind<F, List<Task>> = | |
async { callback: (Either<Throwable, List<Task>>) -> Unit -> | |
Option.fromNullable(internetStorage[user]).fold( | |
{ callback(UserNotInRemoteStorage(user).left()) }, | |
{ callback(it.right()) } | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment