Conversation
| <button title={{helper 'capitalize-str' user.name}}></button> <!-- Invalid invocation --> | ||
|
|
||
| {{my-component format-date=(helper "moment-format")}} <!-- Creates closure helper --> | ||
| {{my-component format-date=(invoke-helper "moment-format")}} <!-- Invokes helper --> |
There was a problem hiding this comment.
What happens to the existing syntax for invoking helpers, which for this example would be:
?
There was a problem hiding this comment.
that would invoke the helper which generates a string that is passed to the component, like today.
- Fixes typos - Removed references to currently unspecified angle bracket component syntax
|
Yes please, and then deprecate |
|
It can be any of those, but there are priorities in its resolution. value, helper and then component, I think. |
|
Yes, but from a developer point of view, it's ambiguous. Especially for developers new to Ember. |
|
A bit unrelated to the RFC, I guess, but I'm not sure how to solve that, using handlebars syntax. |
|
There's an inconsistency in helper lifespans that I've noticed in a few other cases that we might want to consider as part of this RFC: https://ember-twiddle.com/d869daef1f0c2c8e2808a8e60dc06ca3?numColumns=2&openFiles=templates.application.hbs%2Chelpers.count-up.js |
|
An helper is mostly just a function. Can the problem be solved by simply yielding a function (or action)? Only down side I see is that you can't create a helper that maintain it's own state. |
|
@ming-codes I could, and it's what I'm doing for now, but there is no built in way of invoking that helper in the template, so I have to use ember-composable-helper's compute utility. This proves that it's technically possible, but:
Hence, I think there is room for a feature here. |
|
Does #432 supersede this RFC? |
|
@knownasilya maybe? I haven't seen that until now. |
rendered