Skip to content
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

rootGetterContext expects different arguments than provided by the getter #39

Open
jaredmcateer opened this issue Mar 9, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@jaredmcateer
Copy link

Following the example in the Readme I create a getter in my root store

getters: {
  myGetter(...args) {
    const {state, getters} = rootGetterContext(args);  
  }
}

I am getting the following type error

Argument of type '[RootState, any, any, any]' is not assignable to parameter of type '[any, any]'.
  Types of property 'length' are incompatible.
    Type '4' is not assignable to type '2'.ts(2345)

It seems to be expecting

(method) myGetter(state: RootState, getters: any, rootState: any, rootGetters: any): void
@paleo paleo added the bug Something isn't working label Mar 28, 2020
@niklas-dahl
Copy link

As a workaround

myGetter(storeState, storeGetters): ExplicitType {
      const { state, getters } = rootGetterContext([storeState, storeGetters]);

seems to work

@nerdybeast
Copy link

I'm experiencing this same error with these versions:

  • vue: 2.6.11
  • vuex: 3.6.2
  • direct-vuex: 0.12.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants