You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
computed: {myComputed(){console.log('$supply defined ?',Boolean(this.$supply));returnthis.$supply ? this.$supply.mySupply.someData : null;}}
I see a first log saying this.$supply is undefined. Then, unless this.$supply.mySupply.someData changes, the computed will never be re-evaluated (so always null). Because there is no reactivity on this.$supply itself that is set AFTER the first computed evaluation. So once this.$supply is set, no evaluation of myComputed is triggered.
It seems that simply grasping the supply on beforeCreate instead of created fixes the problem. Or you can make sure not to access your computed value before the created hook. In my case, myComputed was evaluated too soon because I was using watch on a computed value derived from the supply. Using $watch instead on the created hook fixed my problem.
Would it cause issues to use the beforeCreate hook to set this.$supply@Akryum ?
Hello @Akryum,
it looks like subscriptions in vue supply aren't reactive in computed property.
Exemple:
Vue meteor tracker only looks for reactivity in
this.$data.$meteor
but subs from supply aren't registered here.The text was updated successfully, but these errors were encountered: