11

I am building an application using riot.js and jquery. Everything works as expected, however as the code grows, so does my worry that triggering and handling events (.trigger/.on) in random/unexpected places in the code is doing nothing to keep my code organized and quickly understandable.

My questions are:

(1) I would like to keep code for such an application clean and streamlined (event namespaces is one thing that comes to my mind) and

(2) I would like to keep the events on the model clearly separated from events on the DOM in the presenter. How can I achieve these goals in a riot.js based application

Thank you.

Tharif
  • 13,794
  • 9
  • 55
  • 77
Gurunandan Bhat
  • 3,544
  • 3
  • 31
  • 43

1 Answers1

5

You could look at a functional reactive programming approach. Here are some solutions you may be insterested in:

  • Rx.js - The Reactive Extensions for JavaScript from Microsoft
  • Bacon.js - another popular FRP library
  • Kefir.js - less popular but insteresting FRP library
shadeglare
  • 7,006
  • 7
  • 47
  • 59