Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Pusher = require("pusher-js")
- const pusher = new Pusher({
- appId: id,
- key: key,
- secret: secret,
- cluster: cluster,
- useTLS: true
- });
- const channel = pusher.channel("vote-channel") // return an error that says pusher.channel is not a function
- var i = 0
- setInterval(() => {
- if(i == 5){
- i = 0
- announce()
- }
- channel.trigger("vote-event", {
- message: sampleData[i]
- }).then(console.log).catch(e=> console.log(e))
- i++
- }, 1000 * 600);
Add Comment
Please, Sign In to add comment