Replies: 1 comment
-
definitely worth having a benchmark to compare it on large stores first, maybe it's not even worth. What is |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If we make the whole store available in to the template, it becomes a bit hidden which properties our component depends on.
It's a bit more declarative if we do
const {foo, baa} = storeToRefs(useStore())
But if the store has many attributes,
storeToRefs
is going to create a whole bunch of unused refs.It should be possible to solve this using a JS proxy object to create a lazy "store as refs" object.
I'm not too up to speed on the relative costs (creating unused refs vs. proxy overhead) but my hunch is this would be worth it.
Would there be interest in a PR?
While we're at it, maybe
useStoreAsRefs()
would be a nice convenience to have?Beta Was this translation helpful? Give feedback.
All reactions