-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
It looks like it would be fairly simple to add callback support to the useSocketEvent hook.
The API would then support something like this:
useSocketEvent('name-of-event', (response) => handleResponse(response));It could be as simple as adding this effect:
useEffect(() => callback(lastMessage), [lastMessage]);(Probably not wise to add callback to deps, because callback will change on every render)
Is there a good reason not to include this functionality?
Metadata
Metadata
Assignees
Labels
No labels