Created
March 23, 2015 20:37
-
-
Save nomothetis/247e9dd0a72e264bf78b to your computer and use it in GitHub Desktop.
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
func loginProducer(username:String, password:String) -> SignalProducer<UserState, LoginError> { | |
return SignalProducer { sink, disposable in | |
Alamofire.DO_ALAMOFIRE_THINGS { data, response, error in | |
// do error checking and nil checking and send errors. | |
// if all is good, send next and complete. | |
} | |
} |> tryMap(validateServerError) |> tryMap(validateLogin) |> tryMap(parseLogin) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment