Socket
Socket
Sign inDemoInstall

async-container

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-container

A utility component to react to promise state changes in the DOM.


Version published
Weekly downloads
11
Maintainers
1
Weekly downloads
 
Created
Source

async-container

Build Status npm Version Ember badge

This addon enables a declarative way to react to actions which return a promise. When dealing with actions, it's common to represent the UI state while an async action is resolving. For example, a save button that needs to be disabled while a save request is in flight.

Example Usage

{{!-- templates/example.hbs --}}
{{#async-container (action 'save') as |async|}}
  <button {{action async.invoke}} disabled={{async.inFlight}}>
    {{#if async.inFlight}}
      Saving
    {{else}}
      Save
    {{/if}}
  </button>
{{/async-container}}
// controllers/example.js
import Ember from 'ember';

export default Ember.Controller.extend({
  actions: {
    save() {
      return this.get('model').save();
    }
  }
});

Installation

  • ember install async-container

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

Keywords

FAQs

Package last updated on 31 Jan 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc