Normally Palatable Mango

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

Keywords

install

npm i ember-promise

Downloadsweekly downloads

9

version

1.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability