AndrewJHart / backbone-pusher

A simple mixin for Backbone.Collection that makes your data real-time'y with pusher's WebSockets service
MIT License
1 stars 0 forks source link

live data in dashboard update backbone application #1

Open midhunkpaul opened 4 years ago

midhunkpaul commented 4 years ago

in my project we have a live data updation for this we are using backbone js push notification. when am using pusher am getting an error like backbone pusher is undefined how to solve this problem or is there any alternative for this live data updation

this is the source code for collection,

define(['backbone', 'app/models/TestModel', 'BackbonePusher'], function (Backbone, TestModel, BackbonePusher) { return Backbone.Collection.extend({ model: TestModel,

initialize: function () {

    _.extend(this, BackbonePusher.prototype);

    if (_.isFunction(this.initialize)) {
        this.initialize({
            key: 'pusher-key',
            channel: 'yourApp',
            channelSuffix: 'channel',
            messageSuffix: 'message',
            autoListen: true,
            logEvents: true,
            logStats: true,
            filters: {
                status: 'archived'
            }
        });
    }

    return this;
}

}); });

AndrewJHart commented 4 years ago

Just saw this comment - apologies. It’s been a long time since I wrote this and we moved away from pusher however I’ll help however I can. Can u give me more details as to your issue?

AndrewJHart commented 4 years ago

I never packaged this up or anything- you could be missing a requirement or something in your dependency but more likely, I would guess that pusher has changed their library and this code probably doesn’t make use of the updated pusher lib. This is not maintained. If you’re using backbone then I would push your team or manager for a rewrite of the app in react. I think you will find it far superior to backbone, which was one of, if not, the first SPA framework(s).