Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DaQuirm committed Dec 3, 2015
1 parent 681fc1a commit d81a3c9
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions README.md
Expand Up @@ -27,9 +27,6 @@ class TemperatureModel
# nx.Cell is a “spreadsheet cell”
@celsius = new nx.Cell value:-20

measure: ->
@celsius.value = Math.round(Math.random()*50 - 25)

# ViewModel describes data transformation for representation in views
class TemperatureViewModel extends TemperatureModel
constructor: ->
Expand All @@ -51,10 +48,8 @@ AppView = (context) ->
nxt.Text "#{fahrenheit}°F"
nxt.Element 'button',
nxt.Text 'Measure!'
# event-as-a-cell feature is coming :3
nxt.Event 'click', ->
# model methods (commands) initiate data flow
do context.measure
# fake measurement
nxt.Event 'click', context.celsius, -> Math.round(Math.random()*50 - 25)

window.addEventListener 'load', ->
window.model = new TemperatureViewModel
Expand Down

0 comments on commit d81a3c9

Please sign in to comment.