bindable-decor

```coffeescript decor = require("bindable-decor") bindable = require("bindable") factory = decor.factory()

npm install bindable-decor
46 downloads in the last day
180 downloads in the last week
479 downloads in the last month
decor     = require("bindable-decor")
bindable  = require("bindable")
factory   = decor.factory()

factory.use(decor.bindable)
factory.use(decor.preload)
factory.use(decor.virtuals)



class Person extends bindable.Object

  ###
   bindings to properties on this model
  ###

  bindings:
    "firstName, lastName": 
      "fullName":
        "map": 
          "to": (firstName, lastName) ->
            [firstName, lastName].join(" ")

  ###
   validates the properties on this model
  ###

  fields:
    firstName: "string"
    lastName: "string"
    fullName: "string"

  ###
   virtual properties only get called when bound to
  ###

  virtuals:
    classes: (next) ->
      loadClasses @, next

  ###
  ###

  constructor: () ->
    super()


person = new Person({ firstName: "craig", lastName: "condon" })
factory.decorate(person)

# nothing
person.get("classes");

# trigger virtual
person.bind("classes").to (value) ->
  console.log classes
npm loves you