Sharedb is the one to use.
--
You received this message because you are subscribed to a topic in the Google Groups "Derby" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/derbyjs/LaiCtRrsB8k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to derbyjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello,
After a bit more research, I realized that the wrong use
is getting invoked from within sharedb-access. If the text of use
is printed like this:
function ShareDBAccess(backend, options){ if (!(this instanceof ShareDBAccess)) return new ShareDBAccess(backend, options); this.options = options || {}; this.allow = {}; this.deny = {}; console.log(backend.use.toString()); backend.use('doc', this.docHandler.bind(this)); backend.use('apply', this.applyHandler.bind(this)); backend.use('commit', this.commitHandler.bind(this)); this.initBackend(backend); }
The following gets printed:
function use(plugin, options) { // Don't include a plugin more than once var plugins = this._plugins || (this._plugins = []); if (plugins.indexOf(plugin) === -1) { plugins.push(plugin); plugin(this, options); } return this; }
This is the use
function from Racer, but really what it should be is the use
function from ShareDB Backend.
Any ideas how to change this so the correct use
function gets used?
Also, does it perhaps depend on whether or not derby.use(require("sharedb-access"));
is invoked before or after setting up the store?
Regards,
Curran
I think I found the solution, to invoke sharedb-access like this after the store gets created:
require("sharedb-access")(store);