Skip to content

Instantly share code, notes, and snippets.

@fostyfost
Last active November 11, 2021 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fostyfost/453e00f171fa7d8aa22c3ab8fc214452 to your computer and use it in GitHub Desktop.
Save fostyfost/453e00f171fa7d8aa22c3ab8fc214452 to your computer and use it in GitHub Desktop.
Redux Saga Call Effect Return Type
import type { SagaIterator } from 'redux-saga'
declare type CallReturnType<T extends (...args: any) => any> = ReturnType<T> extends Promise<infer U>
? U
: ReturnType<T> extends SagaIterator<infer U>
? U
: ReturnType<T>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment