eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.44k stars 1.45k forks source link

How can you remove face tracking listener? #218

Open notalentgeek opened 7 years ago

notalentgeek commented 7 years ago

I have this code face_detection.on("track", function (e) { how can I remove or alter the this listener? If I re - add another on("track" listener will that merge or replace the previous one?

krhoyt commented 7 years ago

Rather than use "on" there is also "addListener(event, handler)" and "removeListener(event, handler)" or "removeAllListeners(optional_event)". If you intend to fire the event only once, that is supported using "once(event_name, handler)". See the EventEmitter class for full details.