Skip to content

Commit

Permalink
Merge pull request #5039 from bekzod/es6-import
Browse files Browse the repository at this point in the history
use prop destructor for Ember dependencies
  • Loading branch information
stefanpenner authored Jun 26, 2017
2 parents b877a37 + b86fe0e commit 950c72e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
7 changes: 1 addition & 6 deletions addon/-private/system/model/errors.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import Ember from 'ember';
import { deprecate, warn } from '@ember/debug';

const get = Ember.get;
const set = Ember.set;
const isEmpty = Ember.isEmpty;
const makeArray = Ember.makeArray;

const MapWithDefault = Ember.MapWithDefault;
const { get, set, isEmpty, makeArray, MapWithDefault } = Ember;

/**
@module ember-data
Expand Down
2 changes: 1 addition & 1 deletion addon/-private/system/record-array-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ export default class RecordArrayManager {

destroy() {
this.isDestroying = true;
Ember.run.schedule('actions', this, this.willDestroy);
emberRun.schedule('actions', this, this.willDestroy);
}
}

Expand Down
14 changes: 7 additions & 7 deletions addon/adapters/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import { instrument } from 'ember-data/-debug';
import { warn, deprecate } from '@ember/debug';
import { DEBUG } from '@glimmer/env';


const {
MapWithDefault,
get
get,
run
} = Ember;

const Promise = Ember.RSVP.Promise;
Expand Down Expand Up @@ -1061,7 +1061,7 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, {
hash.success = function(payload, textStatus, jqXHR) {
heimdall.stop(token);
let response = ajaxSuccess(adapter, jqXHR, payload, requestData);
Ember.run.join(null, resolve, response);
run.join(null, resolve, response);
};

hash.error = function(jqXHR, textStatus, errorThrown) {
Expand All @@ -1071,7 +1071,7 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, {
errorThrown
};
let error = ajaxError(adapter, jqXHR, requestData, responseData);
Ember.run.join(null, reject, error);
run.join(null, reject, error);
};

adapter._ajaxRequest(hash);
Expand Down Expand Up @@ -1442,12 +1442,12 @@ if (isEnabled('ds-improved-ajax')) {
let { method, url } = request;
let requestData = { method, url };

return new Ember.RSVP.Promise((resolve, reject) => {
return new Promise((resolve, reject) => {

hash.success = function(payload, textStatus, jqXHR) {
heimdall.stop(token);
let response = ajaxSuccess(adapter, jqXHR, payload, requestData);
Ember.run.join(null, resolve, response);
run.join(null, resolve, response);
};

hash.error = function(jqXHR, textStatus, errorThrown) {
Expand All @@ -1457,7 +1457,7 @@ if (isEnabled('ds-improved-ajax')) {
errorThrown
};
let error = ajaxError(adapter, jqXHR, requestData, responseData);
Ember.run.join(null, reject, error);
run.join(null, reject, error);
};

instrument(function() {
Expand Down
5 changes: 2 additions & 3 deletions addon/serializers/embedded-records-mixin.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Ember from 'ember';
import { warn } from '@ember/debug';

const get = Ember.get;
const set = Ember.set;
const camelize = Ember.String.camelize;
const { get, set } = Ember;
const { camelize } = Ember.String;

/**
## Using Embedded Records
Expand Down
2 changes: 1 addition & 1 deletion addon/serializers/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DEBUG } from '@glimmer/env';
import JSONSerializer from "../serializers/json";
import { coerceId, modelHasAttributeOrRelationshipNamedType, normalizeModelName, isEnabled } from '../-private';

let camelize = Ember.String.camelize;
const { camelize } = Ember.String;

/**
Normally, applications will use the `RESTSerializer` by implementing
Expand Down

0 comments on commit 950c72e

Please sign in to comment.