Created
February 10, 2017 08:39
-
-
Save cjndubisi/1e2f6519cce54a0091422d0e5a7a9f34 to your computer and use it in GitHub Desktop.
CreateWithPromise
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
| func createProfile(with details: [String:Any]) -> Promise<Profile> { | |
| return firstly | |
| { | |
| // return a promise to signup | |
| auth.signup(with: details) | |
| }.then { _ in | |
| // I don’t need the value I only care that It passed. | |
| auth.signIn(email: email, password: password) | |
| }.then { | |
| auth.user(with: details) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment