With the ACE Editor, how can I unbind an event?
-
19-04-2021 - |
Pregunta
https://github.com/ajaxorg/ace/wiki/Embedding---API
editor.session.on('change', callback);
is how you bind an event to "change". But how do I unbind it?
Solución
Use removeListener
to remove a specific callback.
editor.session.removeListener('change', callback);
or a shorter version
editor.session.off('change', callback);
Use removeAllListeners
to remove all callbacks.
editor.session.removeAllListeners('change');
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow