Created
January 21, 2021 04:52
-
-
Save JimmyLv/59482a9fc5a71c02ae8fc921321026b6 to your computer and use it in GitHub Desktop.
Created with Copy to Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FriendStatus(props) { | |
// ... | |
useEffect(() => { | |
// ... | |
ChatAPI.subscribeToFriendStatus(props.friend.id, handleStatusChange); | |
return () => { | |
ChatAPI.unsubscribeFromFriendStatus(props.friend.id, handleStatusChange); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment