Javascript 你能在meteor中增加一个反应var吗?

Javascript 你能在meteor中增加一个反应var吗?,javascript,meteor,Javascript,Meteor,有可能增加流星中的反应var吗 例如: var price = new ReactiveVar(0) somefunction()=>{ price += 5; } 当然,这是可能的。否则,反应式变量将毫无用处 const price=new ReactiveVar(0); 常量somefunction=()=>{ price.set(price.get()+5); }; 有用的链接:。当然,这是可能的。否则,反应式变量将毫无用处 const price=new ReactiveVa

有可能增加流星中的反应var吗

例如:

var price = new ReactiveVar(0)

somefunction()=>{
price += 5;
}

当然,这是可能的。否则,反应式变量将毫无用处

const price=new ReactiveVar(0);
常量somefunction=()=>{
price.set(price.get()+5);
};

有用的链接:。

当然,这是可能的。否则,反应式变量将毫无用处

const price=new ReactiveVar(0);
常量somefunction=()=>{
price.set(price.get()+5);
};

有用的链接:。

我想这是可能的,只是我问“怎么做”的方式。谢谢你,不客气。我已经更新了答案并添加了文档链接。顺便说一句,别忘了接受我的回答。我想这是可能的,只是我问‘怎么做’的方式。谢谢你,不客气。我已经更新了答案并添加了文档链接。顺便说一句,别忘了接受我的回答。