use-event-listener icon indicating copy to clipboard operation
use-event-listener copied to clipboard

adding duplicate events

Open iamaamir opened this issue 3 years ago • 1 comments

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.

iamaamir avatar Mar 09 '21 13:03 iamaamir

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

braintreeps avatar May 27 '14 20:05 braintreeps

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.

charlie-hadden avatar May 28 '14 09:05 charlie-hadden

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

braintreeps avatar May 28 '14 19:05 braintreeps