Skip to content

Instantly share code, notes, and snippets.

View miconblog's full-sized avatar
🏠
Working at home

Sohn, ByoungDae miconblog

🏠
Working at home
View GitHub Profile
@miconblog
miconblog / protips.js
Created July 10, 2018 13:05 — 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!");