mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
363 stars 93 forks source link

how do I remove a listener which was attached using the ConnectionPromise.on() #244

Closed AkhilKamath closed 1 year ago

AkhilKamath commented 1 year ago

ConnectionPromise constructor just exposes the .on(), .once(), & .listener() functions of the #conn object. there doesn't seem a way to remove a listener that was attached using on()

rusher commented 1 year ago

All EventEmitters methods where not available on connection. This will be the case in next release

rusher commented 1 year ago

corrected with 3.2.0 release.

AkhilKamath commented 1 year ago

Hi @rusher , thanks for the updates and support of event emitter methods! Is there a reason we are not exposing the emit() method? In my code I am handling connection error events but unable to write a testcase for it as I cannot forcefully call the emit method to emit an error event and test my error handling code.