adopted-ember-addons / adopted-ember-addons/ember-paper

paper-button async aware

未关闭
#569 10 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
879
派生
327
PR 合并指标
30 天内没有已合并 PR

描述

Would be nice if the paper-button could be async aware, that is accept a promise as a return value on the `onClick` action, mainly for the form usecase.

```hbs
{{#paper-button type='submit' onClick=(action returnsPromise)}}
Submit
{{else}}
Submitting..
{{/paper-button}}
```

Or if the form component handles the action, it could pass down the promise in the yields:

```hbs
{{#paper-form onsubmit=(action withPromise) as |f|}}
{{#f.submit-button}}
Submit
{{else}}
Submitting..
{{/f.submit-button}}
{{/paper-form}}
```

Where the form passed it down:
```hbs
{{yield (hash
submit-button=(component 'paper-button' promise=submitPromise)
)}}
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。