anthonygore / vuex-undo-redo

Undo/Redo plugin for Vuex
MIT License
174 stars 39 forks source link

Bug: vuex-undo-redo subscribes once per component #22

Open caugner opened 4 years ago

caugner commented 4 years ago

I'm trying to trace down performance issues with regard to the undo functionality provided by this plugin.

When adding a console.log statement to created() here:

https://github.com/anthonygore/vuex-undo-redo/blob/6e34a39718320fbf956fb505ed3b13857c9678ce/src/plugin.js#L17-L28

I noticed that this callback is actually called several times, basically once for each created component, which leads to Vuex accumulating hundreds of subscribers.

I'm not sure how to fix this though.

dpeckham commented 3 years ago

Yes, I'm curious on this one.