I'm trying to use arcgis js api in a vue application which manages state with vuex. Since I have several components that uses the mapview (e.g. search, measure, etc), I would like to share the mapview object via the vuex state. When I try to do this, I get errors like this:
Error: [vuex] do not mutate vuex store state outside mutation handlers.
I'm guessing this is because the mapview is mutating internally. For example the extent is changing when panning the map. Based on this I was thinking that I cannot use vuex to share the mapview. However, there is a project on github (https://github.com/munkh-altai/ArcGIS-Vue) where they actually do this without producing any errors. I've tried replicating the logic of this project in my project but I still get errors.
Does anyone know if it is possible to share the mapview/sceneview/map-object in a vuex store? If so, how?