We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
when-ok
For the occasions when you only care that the form passes and do not need a value from it, I find myself using when-let-ok?:
when-let-ok?
(f/when-let-ok? [_ (some-fn-that-returns-a-failure-or-a-value...)] ::woohoo)
I propose to add the macro when-ok:
(defmacro when-ok [form & body] (when-let-ok? [_# ~form] ~@body))
So we can write:
(f/when-ok (some-fn-that-returns-a-failure-or-a-value...) ::woohoo)
Happy to do a PR for this with tests if you're interested in adding it.
ps. Great library by the way, thank you for your efforts!
The text was updated successfully, but these errors were encountered:
Isn't it just combination of when and f/ok??
when
f/ok?
(when (f/ok? (some-fn-that-returns-a-failure-or-a-value)) ::woohoo)
Sorry, something went wrong.
Not exactly, (when (f/ok? ... returns nil on a failure whereas I'd like to return the failure.
(when (f/ok? ...
No branches or pull requests
For the occasions when you only care that the form passes and do not need a value from it, I find myself using
when-let-ok?
:I propose to add the macro
when-ok
:So we can write:
Happy to do a PR for this with tests if you're interested in adding it.
ps. Great library by the way, thank you for your efforts!
The text was updated successfully, but these errors were encountered: