js:add notification plugin

This commit is contained in:
pengfei.zhou
2020-01-08 19:44:24 +08:00
committed by osborn
parent b4018abe9f
commit b520ffb5df
10 changed files with 119 additions and 1 deletions

View File

@@ -1310,6 +1310,17 @@ var doric = (function (exports) {
register(instance) {
this.entity = instance;
}
function2Id(func) {
const functionId = uniqueId('function');
this.callbacks.set(functionId, {
resolve: func,
reject: () => { loge("This should not be called"); }
});
return functionId;
}
removeFuncById(funcId) {
this.callbacks.delete(funcId);
}
}
const gContexts = new Map;
const gModules = new Map;

View File

@@ -1333,6 +1333,17 @@ class Context {
register(instance) {
this.entity = instance;
}
function2Id(func) {
const functionId = uniqueId('function');
this.callbacks.set(functionId, {
resolve: func,
reject: () => { loge("This should not be called"); }
});
return functionId;
}
removeFuncById(funcId) {
this.callbacks.delete(funcId);
}
}
const gContexts = new Map;
const gModules = new Map;