Skip to content

Instantly share code, notes, and snippets.

@azu
Last active August 29, 2015 14:00
Show Gist options
  • Save azu/189086ce04aad16f99ff to your computer and use it in GitHub Desktop.
Save azu/189086ce04aad16f99ff to your computer and use it in GitHub Desktop.

continueAnyway があるcontextでPromiseが使える状態であるなら、 maybePromise は常にpromiseオブジェクトとして扱った方がよさそう。

var continueAnyway = function (maybePromise, next) {
    return Promise.resolve(maybePromise).then(next);
    // エラーハンドリング忘れ予防もした方は何か合ったほうがいいのかなー?
}

参考文献

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment