Skip to content

Instantly share code, notes, and snippets.

@optimistanoop
Last active January 13, 2017 19:17
Show Gist options
  • Save optimistanoop/fe02304516e2153c2d126c378eb29649 to your computer and use it in GitHub Desktop.
Save optimistanoop/fe02304516e2153c2d126c378eb29649 to your computer and use it in GitHub Desktop.
Promise in Js
// Promises are different then events in these ways-
// 1- They are called only once.
// 2- we can have simple chaining then nested and complex chaining.
// 3- They are wrapped in try catch block
// 4- If a promise return any value , that itself becomes then-able.
// 5- Promise can be handled once it is already settled unlike eventHandlers we can't handle an event before setting eventHandlers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment