Namespace: masseuse/MasseuseModel

masseuse/MasseuseModel

A Backbone Model with Proxy and Computed Properties. Proxy and Computed properties are tirggered directly and not via events for performance reasons.

Infinite Nesting

Masseuse Models support infinite nesting. The properties of a model can be get() or set() infinitely deep.

// 'change:object' event triggered
model.set('object.nestedObject.tripleNestedObject', 'Holy Diver');

model.get('person.address.state.population.something.someOtherThing');

When setting a nested field, the model events are triggered for the appropriate model attribute.

Source:

Extends

  • Backbone.Model

Methods

bindComputed(key, computed)

Attach a ComputedProperty to a model and setup listeners for it.

Parameters:
Name Type Description
key
computed
Source:

bindObserver(key, proxy)

Parameters:
Name Type Description
key
proxy
Source:

bindProxy(key, proxy)

Parameters:
Name Type Description
key
proxy
Source:

get(key) → {*}

Parameters:
Name Type Description
key
Source:
Returns:
Type
*

getListenableValues(listenables) → {Array}

Parameters:
Name Type Description
listenables
Source:
Returns:
Type
Array

set(key, val, options) → {set}

Parameters:
Name Type Description
key
val
options
Source:
Returns:
Type
set

toggleAttribute(attribute)

Parameters:
Name Type Description
attribute
Source: