You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the above I forgot that fs.ensureDir returns the directory path, so I'll have a bug where cb in the second task is assigned to the wrong thing, and it'll take me a while to catch. For an api with sparse documentation, sometimes I dont really know what arguments the callback will have. This is more tricky when the callback takes several arguments. So I was thinking of making a variation of run-waterfall (run-waterfall-uniform?) that always has tasks with two parameters, where the first parameter is always the array of callback arguments, and the second parameter is always the callback function:
This is just a question/idea post:
Sometimes I accidentally do not list the correct parameters in the next task in the waterfall:
In the above I forgot that
fs.ensureDir
returns the directory path, so I'll have a bug wherecb
in the second task is assigned to the wrong thing, and it'll take me a while to catch. For an api with sparse documentation, sometimes I dont really know what arguments the callback will have. This is more tricky when the callback takes several arguments. So I was thinking of making a variation ofrun-waterfall
(run-waterfall-uniform
?) that always has tasks with two parameters, where the first parameter is always the array of callback arguments, and the second parameter is always the callback function:The advantage is just that I know my
cb
will always get assigned correctly. Whaddya think?The text was updated successfully, but these errors were encountered: