bruth / synapse

Hooks to support data binding between virtually any object.
http://bruth.github.com/synapse/docs/
BSD 2-Clause "Simplified" License
150 stars 6 forks source link

Demo with simple Javascript objects? #34

Open kokujin opened 10 years ago

kokujin commented 10 years ago

I would like to try Synapse out. Coming from Knockout, I would like to replicate my code using Synapse for comparison. Is there an example that uses plain JavaScript Objects or function constructors instead of a backbone model? Thanks

bruth commented 10 years ago

Plain objects can only be observers since no native event system exists for object primitives. You can add your own event system that would trigger when keys or values change on the object (as Backbone does and many others). This would allow other objects to observe your event-driven objects. A bit more info here: http://bruth.github.io/synapse/docs/#plain-objects