bionode / bionode-watermill

💧Bionode-Watermill: A (Not Yet Streaming) Workflow Engine
https://bionode.gitbooks.io/bionode-watermill/content/
MIT License
37 stars 11 forks source link

Generalize traverse for resolving functions #8

Closed thejmazz closed 8 years ago

thejmazz commented 8 years ago

Code is duplicated a few times, had a function before but it was not flexible enough

Need to be careful about infinite recursion, if default in the switch calls itself repeatedly

https://github.com/bionode/bionode-waterwheel/blob/3dcaca6b7af2f73ab1abe8e1abb92ed02f745f8c/lib/Task.js#L51-L79

https://github.com/bionode/bionode-waterwheel/blob/3dcaca6b7af2f73ab1abe8e1abb92ed02f745f8c/lib/Task.js#L82-L110

https://github.com/bionode/bionode-waterwheel/blob/3dcaca6b7af2f73ab1abe8e1abb92ed02f745f8c/lib/Task.js#L179-L204