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
🎷 confusing dom-if / falsey detection for initial values #2447
Comments
👍 |
ping @tjsavage -- This is something that keeps being a headache across applications that I am building, any thoughts? |
another ping on this issue 📟 I think the use-case of this can be expressed quite simply: I want to hide a content area while a scope var is not defined, and instead show a loading indicator.. you would think we could do
I would love to hear how other people are dealing with this, because it is something I continually hit when building async applications where data flows into my "state" post render |
I think this is quite reasonable, and probably fits into our roadmap goal of "Fix and make usage of |
some non breaking syntax ideas to enable this behavior... (evaluating foo even if it is undefined)
@nazar-pc @JeremybellEU any thoughts in this area? |
The syntax might be troublesome for new developers whom would confuse the 3 In the last hour I have tried to understand the annotation setup mechanics. I have found when things are initiated, but sadly lack the experience where all calls land (they jump between files). For me it seems most logical if all properties are initially Evaluating right away might lead into problems of ordering of properties, as shown in #2674 . |
I personally don't have problems with PR I want to mention here is #2205, it basically does what Hack fix section suggests but with nice syntax: properties: {
zap: ''
}, I'm not sure it solves initial problems, I also had difficulties with |
It seems like a bug that the default value of a type is not used when defining it in Properties. |
+1 Facing the same issue with Boolean type also. |
We have discussed this use-case and decided that it is working as intended. As the data-binding system of Polymer relies on a push-model (e.g. when you set values, side effects like bindings run), a value that has yet to be set ( We do agree that this notion is different than the falsiness of |
◼️ Given
🌖 Expected
🌍 What happens IRL
tank never shows... and then wow shows (in 1 second)
✏️ Hypothesis
because
zap
is never "defined" polymer does not try and negative a value that has not been resolved💻 🔨 Hack fix
🍝 Ideal fix
In a dom-if... it should try and eval
zap
right away, because ideally I would like to be able to handle the "missing" case without having to define a falsey string val.Thanks for the ⌚
Let me know if this is a terrible idea... feel free to close 💀 🙉
The text was updated successfully, but these errors were encountered: