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

Export pure isOk() function #333

Merged
merged 2 commits into from
Mar 29, 2022
Merged

Export pure isOk() function #333

merged 2 commits into from
Mar 29, 2022

Conversation

screendriver
Copy link
Contributor

import { isOk, ok, Result } from 'true-myth/result';

const myResult: Result<number, string> = ok(42);

if (isOk(myResult)) {
  console.log(myResult.value);
}

Fixes #305

Copy link
Collaborator

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

src/result.ts Outdated Show resolved Hide resolved
@chriskrycho chriskrycho merged commit ba77078 into true-myth:main Mar 29, 2022
@screendriver screendriver deleted the is-ok branch March 29, 2022 04:37
This was referenced Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

important function isOk appears to be missing from the online API docs
2 participants