Vuefire: Being able to watch Firebase properties

Created on 1 Feb 2017  路  3Comments  路  Source: vuejs/vuefire

Watchers should get triggered when put on Firebase properties.

More info on:
https://forum.vuejs.org/t/watching-vuefire-properties/5832/2

Most helpful comment

This happens because the property is added to the Vue instance after the watchers are created.
You have two options:

  • Add the watch with this.$watch in the created hook
  • Add a property to the data object with the same key you're using to bind the reference:
data: { todos: [] }, firebase: { todos: todosRef }

All 3 comments

@KMolendijk Please clearly state the issue here instead of just dropping a link.

The easier you make it for maintainers to understand your problem, the faster they can help.

Also see the guidelines for opening issues.

This happens because the property is added to the Vue instance after the watchers are created.
You have two options:

  • Add the watch with this.$watch in the created hook
  • Add a property to the data object with the same key you're using to bind the reference:
data: { todos: [] }, firebase: { todos: todosRef }

Thanks for pointing out the two fixes @posva. Any ideas why this thread wouldn't show up in a Google search for vuefire, properties, watch, deep, etc.? I seriously hunted for this all morning, and finally just came here directly to browse closed issues. Surely the page has been archived by Google crawlers by now... Anyway, just wanted to point this out in case there are some "make searchable" settings for this repo, etc. I'm going to drop a link in the VueForum where @KMolendijk also asked this. Cheers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

weavermedia picture weavermedia  路  4Comments

konato picture konato  路  7Comments

franciscolourenco picture franciscolourenco  路  7Comments

rstormsf picture rstormsf  路  4Comments

ConnerFrancis picture ConnerFrancis  路  6Comments