Last active
November 11, 2021 09:26
-
-
Save fostyfost/453e00f171fa7d8aa22c3ab8fc214452 to your computer and use it in GitHub Desktop.
Redux Saga Call Effect Return Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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