LoginSignup
1
0

More than 3 years have passed since last update.

VuexFireのAction dispatchが動かない

Posted at

詳細は、Dispatching enhanced action not workingですって。

それもこの時代のREADMEが間違っているのが悪い。(この記事書いている時点で最新なのに)

const setTodosRef = firebaseAction(({ bindFirebaseRef, unbindFirebaseRef }, { ref }) => {
  // this will unbind any previously bound ref to 'todos'
  bindFirebaseRef('todos', ref)
  // you can unbind any ref easily
  unbindFirebaseRef('user')
})

というのをActionsに追加するのであれば、呼び出し側は

    this.$store.dispatch('setTodosRef', db.collection('todos'))

ではなく

    this.$store.dispatch('setTodosRef', { ref: db.collection('todos') })

が正しい。

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0