Last active
May 16, 2019 10:34
-
-
Save klemola/dfb7baaa59b8ee10c6178618a97781a9 to your computer and use it in GitHub Desktop.
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 isNotAsked<T, E>( | |
remoteData: RemoteData<T, E> | |
): remoteData is NotAsked { | |
return remoteData.type === "NotAsked"; | |
} | |
export function isLoading<T, E>( | |
remoteData: RemoteData<T, E> | |
): remoteData is Loading { | |
return remoteData.type === "Loading"; | |
} | |
export function isSuccess<T, E>( | |
remoteData: RemoteData<T, E> | |
): remoteData is Success<T> { | |
return remoteData.type === "Success"; | |
} | |
export function isFailure<T, E>( | |
remoteData: RemoteData<T, E> | |
): remoteData is Failure<E> { | |
return remoteData.type === "Failure"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment