vue-meteor icon indicating copy to clipboard operation
vue-meteor copied to clipboard

Combine params() and update()?

Open Herteby opened this issue 8 years ago • 4 comments

Wouldn't it be possible to pass the same function to Vue's $watch and Tracker.autorun? Then you could get rid of the slightly awkward split. So you can have one function where you can use both Vue's and Meteor's reactive variables, and it will rerun when any of them change.

Herteby avatar Jun 22 '17 21:06 Herteby

I did a quick test and it seems to work :smile:

All I did was add this:

} else {                  //158
  autorun();              //159
  _this.$watch(run);      //160
}                         //161

Was there any particular reason you decided to split them up?

Herteby avatar Jun 27 '17 08:06 Herteby

I remember having weird issues when trying other modules doing this, while this clear separation prevent any edge-case and nasty bug. IMHO, pushing the Tracker replacement by Vue reactivity project is a better solution in the long term.

Akryum avatar Jun 27 '17 09:06 Akryum

Ah yes, that would be the ultimate integration :+1:

Herteby avatar Jun 27 '17 09:06 Herteby

Integration has been finished and now Tracker and Vue reactivity work together. See these repositories for examples and instructions:

  • https://github.com/meteor-vue/guide
  • https://github.com/meteor-vue/todomvc

(We still have to see how to integrate all this with packages in this repository.)

mitar avatar Jul 15 '17 09:07 mitar