Comments (3)
I much prefer the behavior it is using now. It aligns with how Ember templates treat empty arrays. Changing it will make it behave different then how Ember handles empty arrays.
from ember-truth-helpers.
Well, I guess that's a matter of taste. I personally would prefer to have the same behavior in JS and in HBS for similar things - so if ([]) ...
to behave the same as {{if (array) ...}}
. each
is a bit different as it doesn't have a direct equivalent in JS (I mean the else
part of course) - so I agree that the current behavior is OK. But for the if
examples I think that's confusing to people. Besides, you could just write {{if someArray.length ...}}
and that would work the way you want.
from ember-truth-helpers.
So after a nice discussion I'll close the issue as ember-truth-helpers
does the correct thing according to the RFC (even though the RFC says that ember-truth-helpers
does something else - the RFC is wrong in this case).
from ember-truth-helpers.
Related Issues (20)
- Helper "not" has wrong value when passing PromiseProxy
- not-eq has unknown reexport HOT 1
- Helper is-empty returns false when passing undefined
- Update to ember-cli-babel@7 HOT 2
- Update `README` to note that `or`, `and` and `xor` **do** short-circuit HOT 2
- Short-circuit Problem With `SafeString` Using `or` (And Maybe Other Helper)
- Ember Global Deprecation Warning HOT 1
- `or` cant be used when or condition value can be `false` HOT 7
- Project maintenance HOT 4
- Typescript conversion HOT 1
- Can't `npm i` master branch to use with `ember-template-imports` HOT 2
- Cut a release? HOT 12
- Incorrect glint return type for `or` helper in 4.0.0-beta.0 HOT 2
- [QUESTION] `ember-source` compat HOT 3
- `and` returns non-boolean value rather than converting it (which breaks default value logic)
- Document usage with glint additionalSpecialForms config HOT 1
- Memory leaks with `and ` and `or` after they were converted to class based helpers HOT 3
- Array.includes helper? HOT 3
- is-array helper is returning false when array only has one object inside it. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-truth-helpers.