Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md payload & error types #75

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ result = call_api(1)

result.success? # => true on success, false on failure
result.failure? # => true on failure, false on success
result.payload # => nil on failure, payload type on failure
result.error # => nil on success, error type on failure
result.payload # => raises error on failure, payload type on failure
result.error # => raises error on success, error type on failure
result.payload_or("fallback") # => returns payload on success, given value on failure

# You can combine all the above to write flow-sensitive type-checked code
Expand Down
Loading