Created
March 7, 2021 12:48
-
-
Save onedebos/27ae29c7a8eb954992bc2ff34177c1cb to your computer and use it in GitHub Desktop.
/pages/_app.js
This file contains 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
import '../styles/globals.css' | |
import Pusher from 'pusher-js' | |
function MyApp({ Component, pageProps }) { | |
const {key, cluster} = process.env | |
const pusher = new Pusher(key, { | |
cluster | |
}); | |
const channel = pusher.subscribe('chat'); | |
channel.bind('chat-event', function(data) { | |
return data | |
}); | |
return <Component {...pageProps} /> | |
} | |
export default MyApp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment