javascript - Meteor show spinner on method call -


i have button calls method. when method called, have button change , show spinner (inside button itself).

i have made button , css it.

however, lost in how hook functionality show spinner when method called , stop showing when method returns successfully.

how can this? (using template.subscriptionready?)

a simple solution activate spinner in event handler , deactivate in method call callback once method on server has returned or finished:

'click #methodbutton' : () => {   activatespinner();   meteor.call('some method', (err, res) => {     if(err) throw err;     deactivatespinner();   }); } 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -