News for hackers. Stuff that matters.
Re:Smalltalk MVC Translated to JavaScript by malandrew on Tuesday January 06, 2015 @01:09AM (#8843138)
Very relevant:

Unidirectional JavaScript talk from Raynos:

https://www.youtube.com/watch?v=RLAjMeR8898

The "framework" used is mercury:

https://github.com/Raynos/mercury

I use "framework" in quotes because it's really just a collection of libraries that work well together.

Here's the todomvc:

https://github.com/Raynos/mercury/tree/master/examples/todom...

All the state in a mercury app is set up first using lenses (bidirectional/bijective data structure) implemented use:

https://github.com/Raynos/observ

https://github.com/Raynos/observ-struct

https://github.com/nrw/observ-varhash

If you have any application with state, these three libraries work extremely well together.

Basically all the views are pure functions that receive the current state of the app. You can even do "time-travel":

https://github.com/Raynos/mercury/blob/master/time-travel.js

See browser.js of todomvc to see time travel in use:

https://github.com/Raynos/mercury/blob/master/examples/todom...

elm-html is also worth checking out:

https://github.com/evancz/elm-html

Both mercury and elm-html rely on virtual-dom:

https://github.com/Matt-Esch/virtual-dom

Anyways, small modular libraries FTW!

There are no comments on this comment yet.