added context hook to allow the override of the default binder

This commit is contained in:
Sebastian Sdorra
2020-02-19 09:47:52 +01:00
parent fac46d636f
commit 041a999a01
4 changed files with 51 additions and 3 deletions

View File

@@ -10,11 +10,13 @@ type ExtensionRegistration = {
* The Binder class is mainly exported for testing, plugins should only use the default export.
*/
export class Binder {
name: string;
extensionPoints: {
[key: string]: Array<ExtensionRegistration>;
};
constructor() {
constructor(name: string) {
this.name = name;
this.extensionPoints = {};
}
@@ -73,6 +75,6 @@ export class Binder {
}
// singleton binder
const binder = new Binder();
const binder = new Binder("default");
export default binder;