direct-vuex icon indicating copy to clipboard operation
direct-vuex copied to clipboard

localGetterContext doesn't solve recursive typing

Open lyle45 opened this issue 4 years ago • 0 comments

If I understood the docs, using localGetterContext should resolve the issue with the return types being included in rootGetterContext recursively, by not typing root contexts. Many modules never access anything outside their slice so root context is rarely used

however, localGetterContext would still type local state and getters (makes sense right?), so returning any part of the module state without specifying return type would still cause recursive typings. Same for localActionContext

So, either I misunderstood and misused local contexts, or they don't solve the recursive issue from moduleGetterContext

In any case I'd love an explanation about what they're for or how to use them correctly?

code e.g.

image

image

lyle45 avatar Feb 07 '21 17:02 lyle45