3 ms·
This is essentially how I have been writing JavaScript and Node.js code for some time. I actually flatten the code even more, like in these examples[0]. For so
by chapel 13y ago
This is essentially how I have been writing JavaScript and Node.js code for some time. I actually flatten the code even more, like in these examples[0].
For some people, callbacks take more cognition than other solutions, but for someone who has been using callbacks through and through, this is a natural progression and makes sense. It is more straightforward and you don't have to understand further abstractions like in a compile to JS language or with promises.
[0]: https://gist.github.com/chapel/6255720 https://gist.github.com/chapel/6255720
- antihero 13y agoI think I've done pretty much exactly the same thing: https://gist.github.com/radiosilence/2fd82aaf3b1721448ae1 https://gist.github.com/radiosilence/2fd82aaf3b1721448ae1 Except your function names make more sense.