-
Notifications
You must be signed in to change notification settings - Fork 479
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
{?exists/} behavior different when using promises #752
Comments
Thanks for the nice repro case. This is somewhat similar to the @jchan @smfoote what do you think? I can definitely see the value of being able to test the true value of the Promise immediately instead of having to |
Thinking about it a little more, a Promise doesn't have the side effects a context helper may have so evaluating it earlier just changes where we wait for resolution. I think I'm in favor of making this change. |
I made a pull request to resolve the issue: #753. I'm not very familiar with the code in the repo, but I think this resolves things nicely. Either way, thanks for looking into things! |
@sethkinast are you planning a release soon? I'd like to get this fix via npm |
Yes there should be a 2.8.0 soon, see #757 |
My team noticed recently that the {?exists/} behavior is different when promises. The only difference we've seen so far is that if you provide an empty array to an {?exists/} block that it will skip over the logic inside unless you are using promises in which case an empty array provided to an {?exists/} block will still cause the content inside to render. If you know this behavior then a work around is simple, but it'd be preferable to have consistent behavior whether or not we are using promises.
I made a jsfiddle to demonstrate both an {?exists/} block with an empty array and an {?exists/} block with an empty array provided by a promise. Both of these should yield the same result but they do not :(
The text was updated successfully, but these errors were encountered: