Hacker News new | ask | show | jobs
by staltz 4186 days ago
I use a simple example of how Rx (not FRP, that's something completely different) benefits in programming: the traditional use case of analytics events is to spread Analytics.sendEvent() calls in many places of your codebase. Using Rx to solve this problem, things get inverted: you have all analytics events defined in one module, they are listening to events happening throughout the codebase. Sometimes the platform (mobile or whatnot, think beyond JS) provides convenient lifecycle events for this. In conclusion: the only place you see analytics events in your codebase is in the Analytics module.

To me, it's about separation of concerns most of the times, and about handy event operators sometimes (e.g. https://github.com/Reactive-Extensions/RxJS/blob/master/doc/...).