Promises are great for giving us a way of writing asynchronous code without having to indent our code but if that's the only thing you're using them for then you're missing the point of promises. Promises are an abstraction that make doing several things easier. They have two properties that make them easier to work with:
* You can attach more than one callback to a single promise
* values and states (errors) get passed along
Because of these properties it makes common asynchronous patterns using callbacks easy. Here are some cases which may pop up from time to time:
* Converting callback functions to return promises
* Sequential Calls
* Error Handling
* Pool
* Some fun
Your new post is loading...