posva / vuexfire

Check
https://github.com/vuejs/vuefire
MIT License
558 stars 49 forks source link

Use Vue.set to set nested values in walkSet #184

Closed hakatashi closed 5 years ago

hakatashi commented 6 years ago

Currently the state bound by the following code does not trigger view update.

const store = new Vuex.Store({
  state: {
    todos: {
      foo: null,
    },
  },
  actions: {
    setTodosRef: firebaseAction(({ bindFirebaseRef }, { ref }) => {
      bindFirebaseRef('todos.foo', ref);
    }),
  },
});

This is due to Vue's Reactivity Rules. So we should use Vue.set to bind values internally.