vuex-trace

Log actions & mutations in vuex! ๐Ÿš€
3,401 12
Install
npm install vuex-trace
Latest Version:0.0.6
License:MIT
Last Updated:Oct 30, 2020
Links: GitHub  ·  npm
Maintainer: benwinding

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.

Related Packages

pinia-logger

Lightweight logger for Pinia

570,548 11
pinia-logger-nuxt

Lightweight logger for Pinia

17,489 11
vue-logger

the logger module for Vue.js

8,223 14
vue-logger-plugin

Flexible logging functionality for Vue.js 2 & 3

459,555 29
redux-vuex

Redux bindings for VueJS inspired by Vuex.

37,520 40

Version History

Version Released License
0.0.6 MIT
0.0.5 MIT
0.0.4 MIT
0.0.3 MIT
0.0.2 MIT