finished notification

This commit is contained in:
hafifierahman
2024-11-08 22:00:17 +08:00
parent 4c113cb052
commit c4388321aa
9 changed files with 688 additions and 36 deletions
+6 -2
View File
@@ -3,14 +3,18 @@ class SubscribePusher {
this.subscribe = subscribe;
this.event = event;
this.apikey = apikey;
this.pusher = new Pusher(this.apikey, {
cluster: 'ap1', // Replace 'your_cluster' with the actual cluster of your Pusher app
});
}
channel_subscribe() {
let channel = pusher.subscribe(this.subscribe);
channel_subscribe(callback) {
let channel = this.pusher.subscribe(this.subscribe);
channel.bind(this.event, function(data){
callback(data);
});
}
}
export default SubscribePusher;