Skip to content

Instantly share code, notes, and snippets.

@zeptobook
Created June 26, 2020 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeptobook/3ba4c141e9afdb0a4f0140539b2489dc to your computer and use it in GitHub Desktop.
Save zeptobook/3ba4c141e9afdb0a4f0140539b2489dc to your computer and use it in GitHub Desktop.
const p1 = new Promise((res, rej) => setTimeout(res, 1000));
const p2 = new Promise((res, rej) => setTimeout(rej, 1000));
Promise.allSettled([p1, p2]).then(data => console.log(data));
// [
// Object { status: "fulfilled", value: undefined},
// Object { status: "rejected", reason: undefined}
// ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment