Closed yau-ref closed 6 years ago
There are some cases when it is necessary to pass data between the blocks of the flow.
Like there: http://stackoverflow.com/questions/4234619/how-to-avoid-long-nesting-of-asynchronous-functions-in-node-js or there:
function(){ redisClient.smembers("names" this); },function(err, names){ redisClient.select(0,this); },function(){ redisClient.mget(/* `names` is needed here */, this); }
We have two options:
this.varname
So, I've implemented STASH and REVEAL methods for this case:
this.STASH("names", names) .. names = this.REVEAL("names")
There are some cases when it is necessary to pass data between the blocks of the flow.
Like there: http://stackoverflow.com/questions/4234619/how-to-avoid-long-nesting-of-asynchronous-functions-in-node-js or there:
We have two options:
this.varname
- works well, but looks tricky and can cause unexpected behavior in certain circumstances.So, I've implemented STASH and REVEAL methods for this case: