You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a minimal binding library for the DOM. runs with component.io and standalone.
bindings.js uses ES5 getters and setters to get or update DOM elements. Keep in mind that
you should treat this library as another way to access the DOM. Don’t do things like
read, write, read, write… or performance might hurt. For best performance, cache the returned
object of bindings() and only get a new one, when you’ve expected DOM changes. Additionally
specify a root element whenever possible. Before you optimize anything: "Use tools, not rules".
The DOM may not be your bottleneck as it is pretty fast in modern browsers.
bindings().person.name// Maxbindings('person').name// Max
You may specify a root element:
bindings('person',rootElement).name
Convert data to JSON:
varjson=JSON.stringify(bindings('animal'));varjson=JSON.stringify(bindings().animal);// same resultconsole.log(json);// "{"type":"cat","color":"<span>black</span>"}"
Customization
Make a new dev build:
$ make dev
Run tests by opening test/index.html or run:
$ make test
If all of your tests pass, make a new production build (includes standalone build):
$ make
License
The MIT License (MIT)
About
a minimal binding library for the DOM. runs with component.io and standalone.