In this PR, I fixed an issue where addListener and removeListener were not using the same reference for the listener function.
This caused the removal of the listener to fail, as removeListener requires the exact function reference that was initially passed to addListener.
To resolve this, I stored the listener function in a variable and reused it for both adding and removing the listener.
In this PR, I fixed an issue where
addListener
andremoveListener
were not using the same reference for the listener function. This caused the removal of the listener to fail, asremoveListener
requires the exact function reference that was initially passed toaddListener
. To resolve this, I stored the listener function in a variable and reused it for both adding and removing the listener.