Pass pinia options in model
See original GitHub issueHi!
I’m currently working on a project in which I have to migrate from Vue2 with Vuex-ORM into Vue3 with Pinia-ORM. One of the requirements of the project is to persist the store during page reloads (which I try to accomplish with the pinia-plugin-persistedstate plugin). To configure this plugin I have to add an option to my store description.
The issue I’m facing is that I can’t figure out how to access this store description inside of a Model. I can imagine that other plugins will work the same way (options in the store description), so it might be an interesting addition to the package!
My proposed solution is to add a static field to the Model in which you could add options that are inserted (with a spread operator) into the store description. Maybe something like static piniaOptions = {}
?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@JochemVanIterson In fact where is already a way implemented:
the second argument of
useRepo
, takes a pinia store definition.but i defently will be moving pinia store defenitions to the model.
Yes, I’m also using the vuex-orm-axios and graphql plugins, but these are definitely broken on the new version (haven’t tested them though). It’s going to be a long transition I imagine!