Error when calling throttle function from lodash inside MST flow #2008
-
Is this the proper way of using lodash Argument of type '() => Generator<Promise<string> | undefined, void, any>' is not assignable to parameter of type '() => Generator<PromiseLike<any>, void, any>'.
Call signature return types 'Generator<Promise<string> | undefined, void, any>' and 'Generator<PromiseLike<any>, void, any>' are incompatible.
The types returned by 'next(...)' are incompatible between these types.
Type 'IteratorResult<Promise<string> | undefined, void>' is not assignable to type 'IteratorResult<PromiseLike<any>, void>'.
Type 'IteratorYieldResult<Promise<string> | undefined>' is not assignable to type 'IteratorResult<PromiseLike<any>, void>'.
Type 'IteratorYieldResult<Promise<string> | undefined>' is not assignable to type 'IteratorYieldResult<PromiseLike<any>>'.
Type 'Promise<string> | undefined' is not assignable to type 'PromiseLike<any>'.
Type 'undefined' is not assignable to type 'PromiseLike<any>'.(2345) |
Beta Was this translation helpful? Give feedback.
Answered by
coolsoftwaretyler
May 5, 2023
Replies: 1 comment
-
This looks like it might be the issue described in #1378, or related at least. I don't think it necessarily has to do with lodash, but rather with the TypeScript interaction with generators. I was able to clear the error in your TS playground by changing your code to:
Is that helpful for ya? |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
midrizi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This looks like it might be the issue described in #1378, or related at least. I don't think it necessarily has to do with lodash, but rather with the TypeScript interaction with generators.
I was able to clear the error in your TS playground by changing your code to:
as any
…