Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Improving code quality/organization of event-heavy riot applications

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.

like image 872
Ya. Perelman Avatar asked Oct 17 '14 10:10

Ya. Perelman


1 Answers

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
like image 76
shadeglare Avatar answered Sep 28 '22 08:09

shadeglare