Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-promise-block

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-promise-block

Component that shows a loader while a promise is pending.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ember-promise-block

This is an Ember Addon that exposes a component promise-block which shows a loader while a given promise is being resolved.

Installing

Install as an Ember-CLI addon:

ember install ember-promise-block

Usage

// templates/posts.hbs
{{#promise-block promise=postsPromise loaderTemplate='helpers/loader'}}
  {{#each posts as |post|}}
    {{post.title}}
  {{/each}}
{{/promise-block}}

The component will show the partial in loaderTemplate while promise is not resolved. It then shows the block when it resolves. The default value for loaderTemplate is helpers/loader.

Example controller:

// controllers/posts.js
import Ember from 'ember';

export default Ember.Controller.extend({
  postsPromise: function() {
    return this.get('store').query('post');
  }.property(),
  posts: Ember.computed.reads('postsPromise.content')
});

Example model:

// models/post.js
import DS from 'ember-data';

export default DS.Model.extend({
  title: DS.attr('string')
});

Building yourself

  • git clone this repository
  • npm install
  • bower install

Running Tests

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

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc