Skip to content

Migration from vuex-orm, vuex store and model were linked #203

Answered by CodeDredd
jpmc3630 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey again 😄

As you mentioned correctly there is no registration anymore like in vuex-orm-next. I was thinking about your case if it makes sense give useRepo an option to pass something like state, but in my opnionen there is no benefit.

The piniaStore method is not on the Model. It*s on the Repository. Model will never have like vuex-orm-net business logic because pinia-orm and vuex-orm-next are follwing the Data Mapper Pattern

If it's just about line saving and you use the Repo only once in the code then you can also write:

import { useRepo } from 'pinia-orm'
import Media from '@/models/media';
import { useMediaStore } from '@/state/media';

useMediaStore().fetchMedia().then(
  response => 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by CodeDredd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants