Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's like dealing with event handler registrations. You cannot compose those too, as they are "hooks" for when a specific event occurs.

Hook definitions can be a composition of reusable functions and other hooks, like any event handlers (e => filterKeys('cmd+s, ctrl+s', preventDefault(e)).then(save)). It's possible to break this anology (you can register an event handler in an if branch) but I hope it gets the point across.



> It's like dealing with event handler registrations. You cannot compose those too, as they are "hooks" for when a specific event occurs.

Yes, and those are frequently annoying also. Literally the point of the article is the friction they introduce and questioning whether there are better ways to do things. Sometimes there are.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: