You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you consider supporting Pinia setup stores syntax? Currently, pinia-orm supports only the option stores syntax. Using setup stores would provide much more flexibility, allowing us to utilize watchers and composables inside the store itself. Not to mention, this intervention would make the plugin more compatible with Pinia.
After reviewing your code, it seems relatively straightforward to implement. As I understand it (though I could be wrong), the main change involves how the plugin uses the useDataStore function.
To support setup stores, the second argument in the defineStore call needs to be a function that returns an object with reactive properties and methods. There is also an optional third parameter representing a custom options object for additional plugin configurations (e.g., pinia-plugin-persistedstate).
The modified function could look something like this:
As a starting point, perhaps you could provide a way to override this function? You might consider including it as a method in the Query and Repository classes so we can extend those classes.
Regardless, I must point out that you are doing a great job in creating and maintaining this plugin, and it is already excellent even without the proposed feature.
Additional information
Would you be willing to help implement this feature?
Describe the feature
The title says it all.
Would you consider supporting Pinia setup stores syntax? Currently, pinia-orm supports only the option stores syntax. Using setup stores would provide much more flexibility, allowing us to utilize watchers and composables inside the store itself. Not to mention, this intervention would make the plugin more compatible with Pinia.
After reviewing your code, it seems relatively straightforward to implement. As I understand it (though I could be wrong), the main change involves how the plugin uses the
useDataStore
function.Here’s the current function:
To support setup stores, the second argument in the
defineStore
call needs to be a function that returns an object with reactive properties and methods. There is also an optional third parameter representing a custom options object for additional plugin configurations (e.g., pinia-plugin-persistedstate).The modified function could look something like this:
As a starting point, perhaps you could provide a way to override this function? You might consider including it as a method in the Query and Repository classes so we can extend those classes.
Regardless, I must point out that you are doing a great job in creating and maintaining this plugin, and it is already excellent even without the proposed feature.
Additional information
Final checks
The text was updated successfully, but these errors were encountered: