2 ms·
Very relevant: Unidirectional JavaScript talk from Raynos: https://www.youtube.com/watch?v=RLAjMeR8898 https://www.youtube.com/watch?v=RLAjMeR8898 The "frame
by malandrew 12y ago
Very relevant:
Unidirectional JavaScript talk from Raynos:
https://www.youtube.com/watch?v=RLAjMeR8898 https://www.youtube.com/watch?v=RLAjMeR8898
The "framework" used is mercury:
https://github.com/Raynos/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/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
https://github.com/Raynos/observ-struct https://github.com/Raynos/observ-struct
https://github.com/nrw/observ-varhash 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 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/todomvc/browser.js https://github.com/Raynos/mercury/blob/master/examples/todom...
elm-html is also worth checking out:
https://github.com/evancz/elm-html https://github.com/evancz/elm-html
Both mercury and elm-html rely on virtual-dom:
https://github.com/Matt-Esch/virtual-dom https://github.com/Matt-Esch/virtual-dom
Anyways, small modular libraries FTW!