-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
I read #6 and then #7. I saw that handling streams / observables doesn't make sense here, there are other hooks.
My situation is a little different. I'm using nostr, where I create a subscription over a websocket, and then I need to unsubscribe when my component is unmounted. Is there any support for running an async cleanup function in react-async-hook?
Here's an example of what I imagine:
const fetchAndReturnCleanupFunction = async () => {
const unsubscribeFunction = await doSomeSubscribe();
return unusbscribeFunction
}Where I want unsubscribeFunction to be called once my component is unmounted. I don't think that's currently possible with useAsync() right?
Metadata
Metadata
Assignees
Labels
No labels