-
Notifications
You must be signed in to change notification settings - Fork 24
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
STENCIL-3845 Unless helper #126
Conversation
} | ||
} else { // non-block helper | ||
return result; | ||
if (!options.fn || !options.inverse) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is changing the behavior for if
when fn
is not passed. Instead of returning the value, we return true. Is that what we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return values is always a boolean
when called from a non-block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to pass fn
but not inverse
? Should this be
options.fn = typeof options.fn === 'function' ? options.fn : () => true;
options.inverse = typeof options.inverse === 'function' ? options.inverse : () => false;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both need to exist. If one of them is missing, is probably a bug
Customers are trying to use "unless" with operators, the same way "if" works, but we have not implemented this helper.
@bigcommerce/stencil-team