Firstly, that’s not how reactiveVars
are used - you have correctly defined one (var tmpInfo = new ReactiveVar();
), but then overwritten it with a normal variable (tmpInfo = res;
). The correct way to set a reactiveVar
would be tmpInfo.set(res);
. Similarly, to retrieve the value - not return tmpInfo;
, but return tmpInfo.get();
However, I’m pretty sure you can’t do this anyway. Method calls are not reactive, so I think there’s no way for the form to recover the correct value of tmpInfo
before rendering.