0
これが与えるMeteor ReactiveVarの動作は?
Template.hello.onCreated(function(){
var tpl = this;
tpl.dict = new ReactiveDict();
tpl.var = new ReactiveVar();
Session.set('session', undefined);
Tracker.autorun(function(){
console.log(tpl.dict.get('foo'), tpl.var.get(), Session.get('session'));
})
});
Template.hello.onRendered(function(){
var tpl = this;
console.log(this.dict.get('foo'), this.var.get(), Session.get('session'));
tpl.dict.set('foo', 'foo');
tpl.var.set('foo');
Session.set('session', 'foo');
});
(いくつかのパッケージのアップデートためかもしれない?)私は、ユーザーがページの最後に達したときにサブスクリプションを延長するReactiveVarを使用しますが、私は最近、いくつかの奇妙な行動を経験した:
undefined undefined undefined (onCreated)
undefined undefined undefined (onRendered)
foo foo foo (onCreated, after autorun)
を
私の基本的な質問です:これは正常な動作になっていますか? ReactiveVar/Dictは変更されたときに自動的に自動実行されることはありませんか?
これについてのアイデアか、私はちょうど馬鹿ですか? :)