question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[example request] Using with async button

See original GitHub issue

ember-async-button is a super handy component that gives you a link/button with default, pending, failed and success states.

It should naturally integrate with ember-concurrency. I wonder if it’s already possible to use the two with zero boilerplate or there must be some changes made to ember-async-button to minimize glue code?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
maxfierkecommented, Aug 8, 2019

Hi there! I’m going through and closing out old/stale issues that may no longer be relevant due to changes in the ember-concurrency or the larger Ember ecosystem.

ember-async-button has been deprecated as-of March 2018, but it is quite easy to replicate the functionality using ember-concurrency (borrowing example from async-button readme). Here’s an example for posterity’s sake:

<button type="button" onClick={{perform myTask}} disabled={{myTask.isRunning}}>
  {{#if myTask.isRunning}}
    Saving...
  {{else if myTask.last.isSuccessful}}
    Saved!
  {{else if myTask.last.isError}}
    Submission failed
  {{else}}
    Submit
  {{/if}}
</button>
0reactions
lolmauscommented, Jun 1, 2016

@chnn Now imagine my dog pulled out my WiFi router’s cord and the network request failed. How will I know that it failed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Calling async method on button click - Stack Overflow
I've added async to my button click event handler and am await ing the async task but the async task is still running...
Read more >
Fetch API with Async/Await (GET, POST, PUT, DELETE)
Upgrade your fetch() calls with async / await syntax... Professional JavaScript Course: https://bytegrad.com/professional-javascript?n=543  ...
Read more >
How to Easily Call APIs With Fetch and Async/Await in ...
In today's video I'll be showing you how easy it is to call APIs (REST) using the Fetch API in JavaScript and Async...
Read more >
Walkthrough: Accessing the Web by Using Async and Await
The example code is in the SerialAsyncExample project. ... Change the value of the Content property from Button to Start.
Read more >
Building an asynchronous SwiftUI button - Swift by Sundell
When building modern applications, it's incredibly common to want to trigger some form of asynchronous action in response to a UI event.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found