
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
ember-cancelable-button
Advanced tools
This add-on provides a cancelable-button component. When you click the button
and you realize you don't want to take that action, you can just cancel it
within the given timeout by clicking on the "cancel" part of the button.
git clone <repository-url> this repositorycd ember-cancelable-buttonyarn installCheck out examples at https://balinterdi.github.io/ember-cancelable-button.
At a minimum, the action to take should be passed in:
{{#cancelable-button action=(action 'submitProposal')}}
Submit proposal to EmberConf
{{/cancelable-button}}
The component yields out whether the action is scheduled to be sent and the number of seconds it will be sent in.
You can, for example, use that to modify the button's text:
{{#cancelable-button action=(action 'submitProposal') as |isSending sendingIn|}}
{{#if isSending}}
Submitting in {{sendingIn}}...
{{else}}
Submit proposal to EmberConf
{{/if}}
{{/cancelable-button}}
By default, the action is sent in 5 seconds, but a custom delay can be passed
in for the number of seconds (only an integer value will be accepted).
{{#cancelable-button action=(action 'buyBook') delay=2 as |isSending sendingIn|}}
{{#if isSending}}
Buying in {{sendingIn}}...
{{else}}
Buy Rock & Roll with Ember.js
{{/if}}
{{/cancelable-button}}
yarn test (Runs ember try:each to test your addon against multiple Ember versions)ember testember test --serverember builddelaysent.
So a button could go even show "Submitted" (or "Bought") after the action has been carried out.actionFAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.