use-event-listener
use-event-listener copied to clipboard
adding duplicate events
in case of adding events to components via ref the same event is also being added to global (window)
take this below example
https://codesandbox.io/s/usemousemove-demo-forked-lkmq6?file=/src/Password.jsx
when you type anywhere in the document the even is being fired.
Hi Charlie,
Thanks for the pull request!
Can you give us a little more information about why you'd like to make this change? Having a standardized number allows us to offer more consistent behavior and debug issues more easily, and was chosen to line up with our server-side timeouts (the longest of which is 53 seconds, for the entire request). What problems were you running into?
Best, Peter Braintree Developer
Hi there,
While the sandbox was having some issues we had issues with the transparent redirect when adding cards. Specifically, the post request used to confirm what we receive. This was timing out due to the service issues, and it would have been nice to be able to make it time out sooner so that we can handle it in a helpful way without having the request hang for a minute.
It's not a huge issue, and one that we can work around, but it would have saved some time if this was possible.
Thank you for the additional information!
From our perspective, the problem with setting a lower timeout is that it increases the chance of the gateway and the client library getting out of sync. Upstream payment processors can have periods of very slow performance, and it's always good to try to avoid situations where the payment is processed but not confirmed.
It's definitely possible to work around those problems, but I think at the moment we would like to keep that complexity out of our public API. We will definitely keep it in mind as we make future changes, though! Thank you again for the pull request.
Best, Peter Braintree Developer