Skip to content

Commit

Permalink
v1.3.0, add destoy event and method to context
Browse files Browse the repository at this point in the history
Ni55aN committed Apr 28, 2019
1 parent 5ad5ac8 commit da6d24d
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rete",
"version": "1.2.3",
"version": "1.3.0",
"description": "JavaScript framework",
"main": "build/rete.common.js",
"module": "build/rete.esm.js",
4 changes: 4 additions & 0 deletions src/core/context.ts
Original file line number Diff line number Diff line change
@@ -35,4 +35,8 @@ export class Context<EventsTypes> extends Emitter<EventsTypes & DefaultEvents> {
this.components.set(component.name, component);
this.trigger('componentregister', component);
}

destroy() {
this.trigger('destroy');
}
}
2 changes: 2 additions & 0 deletions src/core/events.ts
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ export class Events {
warn: [console.warn],
error: [console.error],
componentregister: [],
destroy: [],
...handlers
}
}
@@ -18,4 +19,5 @@ export interface EventsTypes {
warn: string | Error;
error: string | Error;
componentregister: Component;
destroy: void;
}

0 comments on commit da6d24d

Please sign in to comment.