Parse state across async callbacks.
npm install async-state
var asyncState =asyncStatefoo = 'foo'asyncStatefoo = 'bar'
This also works between files. For a more complex example, see the example folder.
Only object references are copied across async bounderies. The content of the object is shared! I.e. the following will get you into trouble:
var asyncState =asyncStateobj = foo: 'foo'// THIS IS BAD!asyncStateobjfoo = 'bar'
To solve that issue, implement your own cloning logic:
var asyncState =asyncStateobj = foo: 'foo'// THIS IS GOOD :)asyncStateobj = foo: 'bar'
Thanks to Andreas Madsen for pointing me towards the