Closed pandabytes closed 9 months ago
Created a code demo for you: https://code.balkan.app/family-tree-js/remove-events-on-update#JS
Thanks @ZornitsaPesheva . The example you show removes the "update" listener from all FamilyTree objects right? What if I only want remove the "update" listener from one FamilyTree object? For example
function updateListener_1(args) {}
function updateListener_2(args) {}
const familyTree_1 = new FamilyTree(...);
const familyTree_2 = new FamilyTree(...);
familyTree_1.onUpdateNode(updateListener_1);
familyTree_2.onUpdateNode(updateListener_2);
// Is it possible to unresgiter updateListener_1 from familyTree_1?
we have added removeListener method for you
clear your browser cache and test this code demo
Nice! Thank you so much!
Hello!
After registering a callback to certain events like
familyTree.onUpdateNode
, how do I unregister the same callback fromfamilyTree
?