trabian/trabian-webapp-core — pull request #6 by trabianmatt (2013-10-09 14:14:23+00:00)
Title: Added `Presenter` class

Presenters are simple models that can be use to store data and logic
related to a view. For instance, a presenter might store the state of an
expandable view and can be used as in `stickit`:

class SomeView extends BaseView

events: 'toggle'

toggle: ->
@presenter.set
expanded: ! @presenter.get 'expanded'

presenterBindings:
':el':
observe: 'expanded'
update: ($el, val) -> $el.toggleClass 'expanded', val

initialize: ->
@presenter = new Presenter
expanded: false

super