-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Actions not recognized when using ActionTree #1461
New issue
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
Comments
const action = typeSafeActions.hello as Function
action() |
Thank you @ktsn for your answer. I don't know if I'm missing something here, but I found it too much of a hassle if every time I need to manually specify the type of my action to be able to test them. Just casting as |
@kktsn Can you please provide some reference on how to test |
Yeah I think a simple fix here is to export Even better (probably for "test-utils") is a provided type guard - but for now casting would suffice. |
Ah right... so I see this has actually already been addressed in #1201. |
Version
3.0.1
Reproduction link
https://github.com/farzadmf/vuex-action-tree-issue
Steps to reproduce
There's no need to run anything, just open the repo in VSCode, and you will see the error. I've added comments to make it clear
What is expected?
When I create an
ActionTree<...>
, I should be able to call my individual Actions on itWhat is actually happening?
When I type my actions to be of type
ActionTree<...>
, then when I call my action(s), I see the error of "no compatible call signatures"I've created constants to be used as names for my actions (so that I don't use strings). At first, I though that is what's causing the problem; that's why I created the 'hello()' function to test, and it seems to me the constants are not an issue here.
The text was updated successfully, but these errors were encountered: