Answer the question
In order to leave comments, you need to log in
Vuex: store reference to library object?
Are there any pitfalls when storing a reference to a third-party library object in a state?
I am writing an application on Vuejs + Vuex + fabric.js, and it is convenient for me to store the created canvas object in storage to manage the canvas in other components.
The problem is that when I saved a reference to an object in a state (through mutation, of course), I had an error "Maximum call stack ..."
I still could not figure out what the problem was, I created a new assembly with vue-cli and experimented there, everything works. Of course, I rewrote my component, because I couldn’t figure out why.
So, I'm worried that it is possible to lay down a link to an object incorrectly, maybe there will be some pitfalls and in the future I will regret it. But if this is the norm of practice, then it turns out it's just my mistake in the code.
Please tell me, am I worrying for nothing?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question