Skip to content

Instantly share code, notes, and snippets.

@cjndubisi
Created February 10, 2017 08:39
Show Gist options
  • Select an option

  • Save cjndubisi/1e2f6519cce54a0091422d0e5a7a9f34 to your computer and use it in GitHub Desktop.

Select an option

Save cjndubisi/1e2f6519cce54a0091422d0e5a7a9f34 to your computer and use it in GitHub Desktop.
CreateWithPromise
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