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

paper-button async aware

Ouverte
#569 10 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
879
Forks
327
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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)
)}}
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.