evt.evt[Attach|Detach]
import { Evt } from "evt";
const evtText= new Evt<string>();
function myCallback(text: string){};
evtText.getEvtAttach().attach(
handler=> console.log(`${handler.callback.name} attached`)
);
evtText.getEvtDetach().attach(
handler=> console.log(`${handler.callback.name} detached`)
);
//"myCallback attached" is printed to the console.
evtText.attach(callback);
//"myCallback detached" is printed to the console.
evtText.detach();Last updated
Was this helpful?