This is just a simple result type so that we can have type checked error handling pretty please.
npm install @gnuxie/typescript-resultThis is just a simple result type so that we can have type checked error
handling pretty please.
This allows you to do cool stuff like this:
``typescriptresult.ok
const result = await api.getCatPictures();
if (isError(result)) {
// forced to handle error here before we can access .We couldn't get the cat pictures
displayError(, result.error);``
return;
}
displayCats(result.ok);