Vuex: How to log all actions on store?

Created on 5 Mar 2017  路  4Comments  路  Source: vuejs/vuex

Is it possible to log actions the same way I can log mutations with plugins?

I have a simple custom plugin to log mutations:

new Vuex.Store
  plugins: [( (store) ->
      store.subscribe (mutation, state) ->
        console.log mutation.type, mutation.payload
    )]

I wonder how can I log all actions called with store.dispatch

Most helpful comment

You can do that for quite some time now, we have store.subscribeAction() for that.

All 4 comments

Hello @iabdulin

Thank your for your interest in this project.

However, your issue is a usage/support question, and the issue tracker is reserved exclusively for bug reports and feature requests (as outlined in our Contributing Guide).

We encourage you to ask it on the forum , Stack Overflow or on gitter and are happy to help you out there.


Short Answer: there's no official API to do this, currently.

reserved exclusively for bug reports and feature requests

I'd like to request this feature ;)

You can do that for quite some time now, we have store.subscribeAction() for that.

Oh great, thanks Linus!

Was this page helpful?
0 / 5 - 0 ratings