It appears that passing in of path upon construction of a store does not properly invoke setPath() which then causes the store/notifying wrapper to not initialise its message hub properly. For example:
var store = require("perstore/store").DefaultStore({
path: "store",
filename: "bar.json"
});
store.add({ foo: "bar" });
Will produce something like:
/node_modules/perstore/store/notifying.js:66
localHub.publish({
^
TypeError: Cannot call method 'publish' of undefined
at exports.Notifying.store.add (/node_modules/perstore/store/notifying.js:66:14)
at exports.when (/node_modules/perstore/node_modules/promised-io/promise.js:360:29)
at Object.exports.Notifying.store.add (/node_modules/perstore/store/notifying.js:64:11)
at Object.defineProperties.save.value (/node_modules/perstore/facet.js:432:27)
at Object.constructor.add (/node_modules/perstore/facet.js:203:39)
Where as the following removes the issue:
var store = require("perstore/store").DefaultStore({
path: "store",
filename: "bar.json"
});
store.setPath("store");
store.add({ foo: "bar" });
It appears that passing in of
path
upon construction of a store does not properly invokesetPath()
which then causes thestore/notifying
wrapper to not initialise its message hub properly. For example:Will produce something like:
Where as the following removes the issue: