javascript - Showing alerts when Meteor user is updated -


i working on meteor application. occasionally, server updates current user data external database. when happens, display alert on whatever page of application open on client side. know meteor.user gets updated automatically on client, clueless how , application monitor user changes , react them. ideas on this?

the user update triggered via post server:

router.map(function() { this.route('/reload_user', {where: 'server'}).post(function() {     var data = this.request.body;     var user = meteor.users.findone({ "profile.id": data.id });      var data = account.getaccountinfo(apikey, secretkey);                meteor.users.update(user._id, {         $set: {             "profile.paywall": data.paywall,         }     });     this.response.end(); }); 

on server side, want expose publication user collection. on client, want auto subscribe publication , handle changed event:

meteor.autosubscribe(function() {   meteor.users.find().observe({     changed: function(item) {       alert(item);     }   }); }); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -