javascripteverywhere / web

💻 Web code examples for JavaScript Everywhere by Adam Scott, published by O'Reilly Media
https://www.jseverywhere.io/
MIT License
75 stars 56 forks source link

fix: asynchronous bug during multiple queries #34

Closed BernieHo closed 2 years ago

BernieHo commented 2 years ago

Fixed an asynchronous bug. If GET_NOTE query finishes before GET_ME query userdata.me.id is still undefined but executed. Fixed by renaming loading, error and data variables in each query and including it in Loading and Error if's.