0.0.6 • Published 4 years ago

vuex-trace v0.0.6

Weekly downloads
94
License
MIT
Repository
github
Last release
4 years ago

vuex-trace

NPM Version License Downloads/week Github Issues Build

Log actions & mutations in vuex! 🚀

screenshot

Usage

// Default usage
import { mutationLogger, actionLogger } from 'vuex-trace'

const store = new Vuex.Store({
  state,
  mutations,
  plugins: [mutationLogger(), actionLogger()]
})

Options

Options are based on the options from vuex's built-in-logger-plugin

// Mutation logger options
mutationLogger({
  // Start with log group open
  collapsed: true,
  // Filter specific types of mutations
  filter: (mutation, stateBefore, stateAfter) => true,
  // Transform state during output
  transformer: state => state,
  // Transform mutation during output
  mutationTransformer: mut => mut,
  // Custom logger implementation
  logger: console
})

// Action logger options
actionLogger({
  // Start with log group open
  collapsed: true,
  // Filter specific types of actions
  filter: (action, stateBefore, stateAfter) => true,
  // Transform state during output
  transformer: state => state,
  // Custom logger implementation
  logger: console
})

Credit

This package was developed from the vuex default logger. And this PR.

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago