May 2018
Intermediate to advanced
492 pages
12h 3m
English
Promise objects can be in one of three states:
Consider this code segment similar to the one we'll use later in this chapter:
notes.read(req.query.key)
.then(note => { return filterNote(note); })
.then(note => { return swedishChefSpeak(note); })
.then(note => {
res.render('noteview', {
title: note ? note.title : "",
notekey: req.query.key,
note: note
});
})
.catch(err => { next(err); });
There are several places where errors can occur in this little bit of code. The notes.read function has several possible ...
Read now
Unlock full access