Continuing from the previous post; lets dive into ways of using promises. First, some helper functions: 1. Pseudo-Observers This involves attaching several handlers to a single promise; all attached handlers are invoked once the promise resolves. I call this the 'pseudo-observer' pattern because each 'observer' gets invoked once (remember promises never leave their resolution state). This explains why promises can't … Continue reading 3 Ways to start using promises
Tag: promise
Introduction to JavaScript Promises
A promise is a value that might not exist because the action needed to produce that value has not been carried out. Thus, after the expected action has run, the promise will have a value indicating the success or failure of the action.