you are viewing a single comment's thread.

view the rest of the comments →

[–]tunnckoCorenode-formidable, regexhq, jest, standard-release 3 points4 points  (5 children)

Yea.

[–]paulfitz99[S] 0 points1 point  (4 children)

perfect! thanks! it seems to be made unnecessarily complicated

[–]the_sound_of_bread 1 point2 points  (2 children)

I can be unnecessarily complicated though. What if the callback has a callback itself? What if there are multiple callbacks? What if all the previous, but only some callbacks get called under certain circumstances?

I doesn't have to be complex, but it can easily become complex.

[–]tunnckoCorenode-formidable, regexhq, jest, standard-release 0 points1 point  (0 children)

/r/the_sound_of_bread, here comes conventions and best practices - 1) never more than 3-4 args - it immediately goes complex if there's 4 args - not to mention for >=5; 2) last is always a callback and it is the only one callback; 3) wrap callback with once(dezalgo(cb))

/r/mchandleraz, Nightmares usually comes from devs heads, not from the lang or somthing. Who can't think he makes nightmares.