javascript - change backbone models on push notification -
I am trying to push the simple backbone app together. I have the backbone collection of the item model. An application can receive events from Pushar that some of those models were updated.
I want to repeat the code with Pushar, so that I have created an app-wide notifier which increases spinal events, pusher receives the event and publishes backbone events.
Now my question is how can I update my model in the collection? I was thinking about compiling the notifier when it was created and tied in the event of Notifier's event that changed the model (event data was), the model that changed, searches for such a model in its collection Accordingly, it updates and publishes the 'change' event so that the view responds accordingly.
Is this a good way? Searching for the right model in the collection can not be very efficient, so I was considering giving the notifier for each model example and all models should be notified on the change and some condition should be applied that only A goal model should respond to the example.
-
There are some libraries That can be used with backbone to push pushers:
Comments
Post a Comment