@joelgrayson/result
v1.0.0
Published
TypeScript type for success with data or error with message
Readme
@joelgrayson/result
Types
- Result - error with message or success with data
- EmptyResult - error with message or success (no data)
- PResult - Result but wrapped in a Promise. Useful as the return type for async functions
- PEmptyResult
Functions
- success(data) - for constructing a success object with that data
- error(message) - for constructing an error object with the provided error messages
