3 ms·
Am I the only one getting itchy fingers from the lack of normalization? This: async function getPeople() { return fetch('/people') } just seems
by lhorie 6y ago
Am I the only one getting itchy fingers from the lack of normalization? This:
async function getPeople() {
return fetch('/people')
}
just seems far more straightforward across the entire stack (where each entry has a `member: boolean` or `type: someEnum` field)
- faizshah 6y agoI agree the example given is poor and as others have pointed out presents a race condition where a DB transaction would be better. I like the introduction to async/await from PouchDB blog: https://pouchdb.com/2015/03/05/taming-the-async-beast-with-es7.html https://pouchdb.com/2015/03/05/taming-the-async-beast-with-e... And their discussion of Promises: https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html https://pouchdb.com/2015/05/18/we-have-a-problem-with-promis...