Replies: 1 comment
-
async orderCart() {
+ const { user } = useAccStore.getState()
const res = await api.orderCart(user.id, get().items) I don't mean doing this is recommended. |
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
-
Is there a way to call another store while inside a store?
Currently, when I call a store inside another store to use it, I get the error "Invalid hook call. Hooks can only be called inside of the body of a function component."
I can do this easily with Vue's composing stores ideas like Pinia library, and vueuse's createGlobalState.
How can zustand handle this?
Here is my sample code:
Beta Was this translation helpful? Give feedback.
All reactions