Skip to content

Instantly share code, notes, and snippets.

View bruceharris's full-sized avatar

Bruce Harris bruceharris

View GitHub Profile
@bruceharris
bruceharris / protips.js
Last active May 4, 2016 00:43 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// 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!");

This example has moved to .

@bruceharris
bruceharris / README.md
Last active January 3, 2016 06:29 — forked from mbostock/.block