-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
I'm looking into the docs and I don't see any info on what's the recommended way to clean up, when using useAsync or useAsyncCallback.
Currently I'm using my own hooks that are simple wraps over useEffect and useState.
useEffect(() => {
const ref = fireGet(path, data => {
cb(data);
});
return () => {
ref.off();
};
}, effectParams || [path]);And I'm refactoring this to react-async-hook and I'm wondering where to put that function that turns off the WebSocket connection.
Looking into the code, there's an option to provide a reset callback. Is that what I need?
Thanks for any info and thanks for creating this lib!
Metadata
Metadata
Assignees
Labels
No labels