Created
August 4, 2024 17:21
-
-
Save igolka97/9e4bdd157b9759525c342439a9e347a8 to your computer and use it in GitHub Desktop.
Fulfilled promise TypeScript assertion
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
export function assertFulfilled<T>( | |
item: PromiseSettledResult<T>, | |
): item is PromiseFulfilledResult<T> { | |
return item.status === 'fulfilled'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment