1
我有兩個按鈕用作點擊時在後端觸發方法的「開始」和「停止」。 EG:在另一個正在執行時調用流星方法
{{#if isExecuting}}
{{>CylonButton method="stop"}}
{{else}}
{{>CylonButton method="start"}}
{{/if}}
流星方法看起來如下。
Meteor.methods({
start: function (data) {
Cylon.downloadData(data); // chunks data and downloads it, could take a while
this.unblock(); // now that it's ready, it can be unblocked.
Cylon.load(); // do this longer running method.
},
stop: function() {
Cylon.stop(); // stop the method. This should _always_ be available
}
});
但是,我不能撥打stop
,直到其他方法解鎖。有沒有解決的辦法?
因爲我不想讓_other_ meteor方法被調用,所以只有'stop' – corvid