Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.
/ proximo Public archive

Model implementation for node.js using the best of Backbone and Harmony proxies

License

Notifications You must be signed in to change notification settings

mattijs/proximo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proximo

Proximo is an experiment to implement Backbone.js' Model class but enhanced with the Harmony Proxy proposal. This allows Model attributes to be accessed like a native JavaScript Object but still enables change events to be fired.

var m = new Model();
m.on('change:foo', function(model, value) {
    console.log('Foo changed to ' + value);
});

// Backbone accessor
m.set('foo', 'bar');
// prints "Foo changed to bar"

// Proximo accessor
m.foo = 'baz';
// prints "Foo changed to baz"

Proximo uses the Harmony Proxy proposal implemented in the v8 engine. This is available by calling node with the --harmony_proxies flag. As an alternative the node-proxy module can be installed.

Proximo is an experiment and is still being developed. Use at your own risk.

Install

$ npm install proximo

The module is tested on node v0.6.19. Other tests will be added soon.

Shortcomings

The Harmony API's are not completely settled yet so the implementation is not final. The new Proxy.for API is not yet implemented in v8 packaged with node v0.6.x. The iterate trap is also unimplemented as it relies on the Harmony iterator proposal which is also not available in node.

License

This module is available under the MIT License. See LICENSE file for full details. Some parts of model.js are taken from backbone.js which is available under the MIT License.

About

Model implementation for node.js using the best of Backbone and Harmony proxies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published