Skip to content

Instantly share code, notes, and snippets.

@emenoh
emenoh / protips.js
Last active August 29, 2015 14:21 — forked from nolanlawson/protips.js
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");