Skip to content

Return something for React effect cleanup for autofill? #30

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

Open
Firehed opened this issue Mar 2, 2024 · 2 comments
Open

Return something for React effect cleanup for autofill? #30

Firehed opened this issue Mar 2, 2024 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@Firehed
Copy link
Contributor

Firehed commented Mar 2, 2024

I'm not sure if this is possible/easy, but in order to nicely clean up React effects (when the SDK is used in a React context), it would be beneficial to expose something that allows for cleanup. This could be a premade function, the abort controller, or something else.

The SDK does most of the important cleanup so this isn't a huge issue, but it would help keep consuming codebases tidier and less full of surprises.

@Firehed Firehed added the enhancement New feature or request label Mar 2, 2024
@Firehed
Copy link
Contributor Author

Firehed commented Jul 22, 2024

Now that signal handling has improved a lot, I think the way to go here (if it's needed at all) would be something to the effect of () => signal.abort('Manually canceled')

@Firehed
Copy link
Contributor Author

Firehed commented Aug 7, 2024

Based on some local experimentation, I think al that needs to happen here is a) change cancelPendingRequests() from private to public, and b) adjust the message sent to the abort controller, for clarity.

@Firehed Firehed added this to the 1.0 milestone Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant