https://github.com/retejs/lifecycle-plugin
https://github.com/retejs/lifecycle-plugin
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/retejs/lifecycle-plugin
- Owner: retejs
- Created: 2018-12-19T21:03:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T21:39:06.000Z (almost 3 years ago)
- Last Synced: 2024-10-30T00:54:46.583Z (about 1 year ago)
- Language: TypeScript
- Size: 355 KB
- Stars: 0
- Watchers: 3
- Forks: 5
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Lifecycle
====
#### Rete.js plugin
```js
import LifecyclePlugin from 'rete-lifecycle-plugin';
editor.use(LifecyclePlugin);
class AddComponent extends Rete.Component {
constructor(){
super("Add");
}
created(node) {
}
destroyed(node) {
}
onconnect(io) { // input or output
return false; // prevent connect
}
ondisconnect(connection) {
return false; // prevent disconnect
}
connected(connection) {
}
disconnected(connection) {
}
}
```
TypeScript
```ts
import { OnCreated, OnDestroyed, OnConnect, OnConnected, OnDisconnect, OnDisconnected } from 'rete-lifecycle-plugin';
class AddComponent extends Rete.Component implements OnCreated, ...
```