Message from JavaScript discussions

May 2019

— Sure e.g when you fetch something

— 

So I ment offline mode, is there a use for it when you want to wait for a reaction after event listener for example

— Or is it just for online stuff

— You can do fetch('text.txt')
.then(res=>res.txt())
.then(data=>data)
.catch(err=>err)

— You use to wait for a promise to be resolved. In node you can use it nicely for file system operations in the browser to fetch any stuff online. You coulf also use it together with setTimeout() to write blocking code with it.

Message permanent page

— Its just about promises

— So when the event listener fires how do I prepare a file for later fetching?

— I didn't get to node.js yet

— Edited

— Async await is just a clean way to work with promises. Not having to chain .then().then()

— Thanks for help guys

— Https://hackernoon.com/step-by-step-guide-to-push-your-first-project-on-github-fec1dce574f