nexus
An MVVM-based client application framework
Installation
Bower
$ bower i nexus
Node.js
$ npm i nexus-node
Example
# Temperature is “measured” and displayed in two scales # Raw business domain model : -> # nx.Cell is a “spreadsheet cell” @celsius = value:-20 # ViewModel describes data transformation for representation in views : -> super @fahrenheit = # Cell-oriented data flow @fahrenheit'<-'@celsius celsius * 1.8 + 32 # Views are plain functions nested arbitrarily and written pseudo-declaratively = nxtElement 'main' nxtElement 'div' # Pin-point rendering will only change this part when # bound data is modified nxtBinding contextcelsius nxtText "℃" nxtElement 'div' nxtBinding contextfahrenheit nxtText "°F" nxtElement 'button' nxtText 'Measure!' # fake measurement nxtEvent 'click'contextcelsius-> MathroundMathrandom*50 - 25 windowaddEventListener 'load'-> window.model = # Attach the view to the DOM (can be any existing node) documentbodyappendChild AppViewmodeldatanode