badrap / result

A TypeScript result type taking cues from Rust's Result and Haskell's Either types
MIT License
292 stars 6 forks source link

return empty error? #6

Closed Grummfy closed 3 years ago

Grummfy commented 4 years ago

Hello, sometimes I jsut want to return an error but with no value, for the moment I do this :

return Result.err(new Error())

But I would prefer something like this

return Result.err()
pawndev commented 4 years ago

I just did a PR for that, waiting for reviewer right now. #7

jviide commented 3 years ago

I'm sorry for the huge delay for reviewing the pull request, I managed to miss the notification about it.

@pawndev's PR has now been merged, and I also added a test and docs for the new functionality. Updated the dependencies as well. The new version has now been published as v0.2.7 in npm.

Thank you 🙂