retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
9.86k stars 647 forks source link

Listeners #72

Closed Hamdiovish closed 6 years ago

Hamdiovish commented 6 years ago

I think it is important to have listeners in many components at some levels, for example a listener when a node is about to be deleted, so developers can free up some ressources associated with that node, or show some alerts, save some data etc.

Ni55aN commented 6 years ago

Something like that?

new D3NE.Component('mycomp', {
    builder(node){ },
    worker(node, inputs, outputs){ },
    created(node){ }.
    destroyed(node){ }
});

I think this can be represented as a node's lifecycle (as it is in Vue.js for components)

Hamdiovish commented 6 years ago

Yes exactly like that! Component's lifecycle feature will give the ability to the library to be used in complex and heavy usages such websocket or whatever.

Ni55aN commented 6 years ago

4085c9e72d087371240025e8a5f6a3d8cb8a2b39

Hamdiovish commented 6 years ago

You're an Artist man, Perfect job, I'm interested in contributing in this project, please consider to comment its code, its main components and build instructions for easier contribution.

Keep up the good work

Ni55aN commented 6 years ago

Thanks! I'll do it in the near future

Ni55aN commented 5 years ago

https://github.com/retejs/lifecycle-plugin