Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1. Old, sucky way of doing async work: callback hell!
- function myCallback(result) {
- this.items = result;
- }
- someAjaxRequest(myCallback);
- // 2. Slightly better way using Promises!
- someAjaxRequest().then(results => this.items = results);
- // 3. New awesome sexy way: async/await!
- this.items = await someAjaxRequest();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement