The result to check.
true
if the result was successful, false
otherwise.
const result: RetryResult<string>
if (isRetryOK(result)) {
console.log(result.ok)
} else {
console.error(result.err)
}
const result: RetryResult<number>
if (isRetryOK(result)) {
result.ok // type: number
} else {
result.err // type: unknown (probably Error)
}
// or
if (!isRetryOK(result)) {
result.err // type: unknown (probably Error)
} else {
result.ok // type: number
}
Generated using TypeDoc
Checks if a RetryResult was successful, i.e. if the
ok
property is defined.