Skip to content

Instantly share code, notes, and snippets.

@kristijan-pajtasev
Created November 25, 2020 10:49
Show Gist options
  • Select an option

  • Save kristijan-pajtasev/b81042455d30aeab1e961711f90467c0 to your computer and use it in GitHub Desktop.

Select an option

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