Created
April 11, 2014 01:20
-
-
Save msanders/dd887cffc4499ebc9514 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
static fromPromise<S>(promise: Parse.Promise<S>): Parse.Promise<Maybe<S>> { | |
return promise.then(x => Maybe.fromValue(x)); | |
} | |
// Example | |
Maybe.fromPromise( | |
this.stack.moment.tz(today, timezone).isoWeekday() === 1 ? generateWeeklyDigest(today) : Parse.Promise.as() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment