ember-promise

1.2.0 • Public • Published

Ember-promise

Build Status

Description

A simple promise object that will wrap xhr resolve/reject with an ember.run

Installation

# install via npm
$ npm install ember-promise --save-dev

Basic Usage

import Ember from 'ember';
import PromiseMixin from 'ember-promise/mixins/promise';
 
var PeopleRoute = Ember.Route.extend({
    model: function() {
        var people = [];
        PromiseMixin.xhr("/api/people", "GET").then(function(response) {
            response.forEach(function(person) {
                people.pushObject(Ember.Object.create(person));
            });
        });
        return people;
    }
});
 
export default PeopleRoute;

Running the unit tests

npm install
ember test

Example project

https://github.com/toranb/ember-cli-store-example

License

Copyright © 2015 Toran Billups http://toranbillups.com

Licensed under the MIT License

Readme

Keywords

Package Sidebar

Install

npm i ember-promise

Weekly Downloads

1

Version

1.2.0

License

MIT

Last publish

Collaborators

  • toranb
  • williamsbdev