I am struggling to understand the Vue meteor option example in the README of the vue-meteor-tracker package https://github.com/meteor-vue/vue-meteor-tracker:
First, I am confused as to whether every Vue
meteor option needs all three elements in the example to reactlvely associate the Vue variables with the Meteor collections:
a) the subscription object
b) the function directly searching the Meteor collection, illustrated by the
threads () function in the example
c) the object containing two functions, the
param function and the
update function, the first one seemingly referencing the Vue variable and the second one seemingly using the first one to search the Meteor collection
or whether each of these three properties of the Vue meteor option corresponds to a distinct use case and one will have to pick one of the three in a given circumstance.
Second, I fail to understand what is the direction and order of the data flow between all these variables: which one gets its value first and which one derives its value from which other one and in what order.
Third, the other examples I found on Github do not match this one:
the Vue meteor option in the example by @akryum himself in https://github.com/Akryum/meteor-vue-example linked as example project in https://github.com/meteor-vue/vue-meteor-tracker, contains neither a direct function nor an object with a
updatefunction but instead a
dataoption nested inside the
meteoroption, a possibility not mentioned in the ReadMe
the TodoMVC example by @mitar found in https://github.com/meteor-vue/todomvc
also linked as illustrative example in the Meteor-Vue github repository, does not use this Vue
meteoroption at all; instead, it only contains a Meteor collection subscription wrapped in an autorun call in Vue
createdlifecycle hook option; interestingly, it also does not use the package
akryum:vuebut nevertheless the
akryum:vue-componentpackage (which I did not know was possible) in addition to a
vuejs:meteor-integrationpackage (was it authored by akryum as well or by some other Vue.js team member?);
this approach seems way simpler to understand than the
updatefunctions but perhaps it is far less powerful/complete? Could akryum, mitar or any other meteor-vue integration guru out there shine some light on that?
the starlist example by @mwarren2 found in https://github.com/quasarframework/quasar-template-meteor does use the
updatefunctions in a Vue
meteoroption, but it puts the Meteor collection subscription inside a Vue
createdlifecycle hook option instead of a Vue
meteoroption or a Vue
mountedlifecycle hook as recommended in https://github.com/meteor-vue/vue-meteor-tracker: and when I try to do the same, adding a call to
this.$subscribe('pubname'),either under a
mountedVue lifecycle hook option, I get an error saying:
this.$subscribe is not a function
Is there any charitable soul out there using Vue+Meteor in production who would be willing to write a few word to explain all those subtleties to the newcomers to the community?
Shine on me craaaaaaaaaazy diamond!