Allow Dataspace subclasses to extend endpoint-addition behaviour

This commit is contained in:
Tony Garnock-Jones 2018-11-11 13:59:01 +00:00
parent 3e3761ee89
commit 066920b771
1 changed files with 6 additions and 1 deletions

View File

@ -238,6 +238,9 @@ Dataspace.prototype.unsubscribe = function (handler) {
this.index.removeHandler(handler, handler.callback);
};
Dataspace.prototype.endpointHook = function (facet, endpoint) {
};
function Actor(dataspace, name, initialAssertions) {
this.id = dataspace.nextId++;
this.dataspace = dataspace;
@ -554,7 +557,9 @@ Facet.prototype.addStopScript = function (s) {
};
Facet.prototype.addEndpoint = function (updateFun, isDynamic) {
return new Endpoint(this, isDynamic === void 0 ? true : isDynamic, updateFun);
const ep = new Endpoint(this, isDynamic === void 0 ? true : isDynamic, updateFun);
this.actor.dataspace.endpointHook(this, ep);
return ep;
};
Facet.prototype.addDataflow = function (subjectFun, priority) {