Skip to content

Latest commit

 

History

History
382 lines (278 loc) · 10.6 KB

README.md

File metadata and controls

382 lines (278 loc) · 10.6 KB

ember-fetch-request

Service for making Fetch requests in Ember applications. Mimics the ember-ajax magic. The way it builts the URL, works with the headers, handles errors, and provides a useful service.

  • customizable service
  • returns RSVP promises
  • improved error handling
  • ability to specify request headers

Getting started

ember install @prysmex-engineering/ember-fetch-request

To use the fetch service, inject the fetch-request service into your route or component.

import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class AnyRoute extends Route {
  @service fetchRequest;
  model() {
    return this.fetchRequest.request('/posts');
  }
}

Fetch Request Service

//TODO: Translate ajax to fetch and update