Skip to content

cyango/lifecycle-plugin

 
 

Repository files navigation

Lifecycle

Rete.js plugin

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

import { OnCreated, OnDestroyed, OnConnect, OnConnected, OnDisconnect, OnDisconnected } from 'rete-lifecycle-plugin';

class AddComponent extends Rete.Component implements OnCreated, ...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 91.4%
  • JavaScript 8.6%