Skip to content

Instantly share code, notes, and snippets.

@kristijan-pajtasev
Created November 25, 2020 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristijan-pajtasev/b81042455d30aeab1e961711f90467c0 to your computer and use it in GitHub Desktop.
Save kristijan-pajtasev/b81042455d30aeab1e961711f90467c0 to your computer and use it in GitHub Desktop.
import {useEffect} from 'react';
import ChatAPI from './ChatAPI';
function ChatComponent() {
useEffect(() => {
ChatAPI.subscribe();
return () => {
ChatAPI.unsubscribe();
}
})
return <div>Chat Component</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment