change(tracker): tracker-vuex 4.0.3

This commit is contained in:
sylenien 2022-09-27 16:45:11 +02:00
parent 8931e118a0
commit 45f3d7b793
2 changed files with 3 additions and 1 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "@openreplay/tracker-vuex", "name": "@openreplay/tracker-vuex",
"description": "Tracker plugin for Vuex state recording", "description": "Tracker plugin for Vuex state recording",
"version": "4.0.2", "version": "4.0.3",
"keywords": [ "keywords": [
"vuex", "vuex",
"logging", "logging",

View file

@ -50,6 +50,7 @@ export default function(opts: Partial<Options> = {}) {
return (storeName: string) => (store) => { return (storeName: string) => (store) => {
// Vuex // Vuex
if (store.subscribe) { if (store.subscribe) {
app.debug.log('Hooked to vuex store')
const randomId = Math.random().toString(36).substring(2, 9) const randomId = Math.random().toString(36).substring(2, 9)
store.subscribe((mutation, storeState) => { store.subscribe((mutation, storeState) => {
state[storeName || randomId] = storeState state[storeName || randomId] = storeState
@ -59,6 +60,7 @@ export default function(opts: Partial<Options> = {}) {
// Pinia // Pinia
if (store.$onAction) { if (store.$onAction) {
app.debug.log('Hooked to pinia store')
store.$onAction(({ name, store, args }) => { store.$onAction(({ name, store, args }) => {
try { try {
state[storeName || store.$id] = store.$state; state[storeName || store.$id] = store.$state;