Skip to content

Commit

Permalink
v1.4.1, add 'clear' event
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni55aN committed Aug 16, 2019
1 parent d032976 commit 7dc966b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
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.4.1-rc.2",
"version": "1.4.1",
"description": "JavaScript framework",
"main": "build/rete.common.js",
"module": "build/rete.esm.js",
Expand Down
1 change: 1 addition & 0 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export class NodeEditor extends Context<EventsTypes> {

clear() {
[...this.nodes].forEach(node => this.removeNode(node));
this.trigger('clear');
}

toJSON() {
Expand Down
4 changes: 3 additions & 1 deletion src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export class EditorEvents extends Events {
contextmenu: [],
import: [],
export: [],
process: []
process: [],
clear: []
});
}
}
Expand Down Expand Up @@ -132,4 +133,5 @@ export interface EventsTypes extends DefaultEventsTypes {
import: Data;
export: Data;
process: void;
clear: void;
}

0 comments on commit 7dc966b

Please sign in to comment.