I am trying to stop Deps.autorun () from executing again after the condition is true:
Deps.autorun(function(computation){
var first_product = Collection.products.findOne({enabled:true});
if( first_product ){
Session.setDefault( 'purchase_dialog.selected_product_id', first_product._id );
console.log( 'set here');
computation.stop();
}
});
I see the βmany hereβ many times, and it continues to run. Why is .stop () not working?
source
share