We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/piniajs?q=example&type=source
TS error 2551
Property 'callAnAction' does not exist on type '{ aStateVariable: boolean } & PiniaCustomStatePr...'. ts(2551)
I use vuetifys v-switch, which uses a v-model that i map with mapWritableState
mapWritableState
Some Template:
...mapWritableState(myStore, ['aStateVariable', ...
To detect when the var changes, i use a getter and call an action
The Store:
state: () => ({ aStateVariable: true }), getters: { myGetter(state) { if (state.aStateVariable) { state.callAnAction() ^^^^^^^^^^^^ TS(2551) } }, }, actions: { callAnAction() { console.log('i got called') } }
The code works, but i got the TS error
No error, or an explanation, that it is prohibited to call an action from a getter.
TS error
No response
The text was updated successfully, but these errors were encountered:
This is intended. No side effects in getters
Sorry, something went wrong.
No branches or pull requests
Reproduction
https://github.com/piniajs?q=example&type=source
Steps to reproduce the bug
TS error 2551
I use vuetifys v-switch, which uses a v-model that i map with
mapWritableState
Some Template:
To detect when the var changes, i use a getter and call an action
The Store:
The code works, but i got the TS error
Expected behavior
No error, or an explanation, that it is prohibited to call an action from a getter.
Actual behavior
TS error
Additional information
No response
The text was updated successfully, but these errors were encountered: