-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove input listeners not accessable on disconnected event #229
Comments
since 3.0.13 the error is now properly showing up with typescript.
|
You should now (v3.0.14) be able to use |
are you sure? |
Yes. However, note that your code adds a listener to the When you remove a listener, you need to remove it from the object where it was added. In this case, if you want to remove all listeners from |
yep, sorry. your right. typescript is complaining about it though. |
Complaining about what? I don't seem to have a problem when I use it. |
its telling me |
I thought you meant the error was triggered by In all honesty, I have no clue why it reports an error. My (very limited) knowledge of TypeScript cannot decipher the error. I'm going to re-open the issue but we will have to find some knowledgeable TypeScript power-user to look into this. Perhaps you could ask in the Discussions and reference this issue? For the record, here is the generated error message:
|
I did some more digging today and I understand what the problem is. Basically, it goes like this:
So, to prevent the error, starting with v3.0.15, I am using a type of P.S. In v3.0.15, |
fair enough. If a solution arises will you make a note to fix it? or put a note somewhere that there is a limitation in the typescript implimentation? Maybe it is an archiectural floor? Maybe connected inputs should be a different events to conntected outputs? |
I am asking for help on StackOverflow about this. Hopefully, someone will chime in... |
I have also started a page with information regarding TypeScript. Hopefully this can act as a reminder of yet-to-solve problems. |
I can think of a few ways to sort this out -- is it still an issue? |
The issue has been "fixed" with the aforementioned ugly workaround but if you have a cleaner solution, I'd love to hear it. Thanks for offering to help! |
my environment is next.js. when i attach the following listener;
i get this error
TypeError: e.port.removeListener is not a function
i tried
e.target.removeListener()
i don't get the error, but i also don't think it removes the listener(s).The text was updated successfully, but these errors were encountered: