sharedb-attribute-binding
A ShareDB binding that allows you to bind element attributes like id
, class
, style
, etc. Element's value is always written even when changing another attribute.
Based on https://github.com/stanographer/sharedb-generic-binding.
As used in boy.dog. The web library that allows you to create real-time collaborative webpages.
Usage
npm install --save sharedb-attribute-binding
// Require it.const AttributeGenericBinding = ; // Setup the connection.const socket = "ws://YOUR_HOST:YOUR_PORT" socketOptions;const connection = socket;const doc = connection; // Subscribe to the document.doc;
Tests
Run npm run test
. They all should work but bear in mind that no tests have been created for all attributes (src, href, id, etc).
License
MIT - Alejandro del Río Santiago @adelriosantiago (boy.dog)