Skip to content

Commit

Permalink
pretty to the prettier gods
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Jul 27, 2018
1 parent e36cd5e commit 471771a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions addon/-legacy-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ Store = Service.extend({

if (DEBUG) {
this._trackedAsyncRequests = [];
this._trackAsyncRequestStart = (label) => {
let trace = 'set `store._generateStackTracesForTrackedRequests = true;` to get a detailed trace for where this request originated';
this._trackAsyncRequestStart = label => {
let trace =
'set `store._generateStackTracesForTrackedRequests = true;` to get a detailed trace for where this request originated';

if (this._generateStackTracesForTrackedRequests) {
try {
Expand All @@ -234,13 +235,13 @@ Store = Service.extend({

let token = Object.freeze({
label,
trace
trace,
});

this._trackedAsyncRequests.push(token);
return token;
};
this._trackAsyncRequestEnd = (token) => {
this._trackAsyncRequestEnd = token => {
let index = this._trackedAsyncRequests.indexOf(token);

if (index !== -1) {
Expand All @@ -254,8 +255,8 @@ Store = Service.extend({
let isSettled = tracked.length === 0;

if ((this.isDestroying || this.isDestroyed) && !isSettled) {
throw new Error('Async Request leaks detected:\n\t - ' +
tracked.map(o => o.label).join('\n\t - ')
throw new Error(
'Async Request leaks detected:\n\t - ' + tracked.map(o => o.label).join('\n\t - ')
);
}

Expand Down
13 changes: 7 additions & 6 deletions addon/-record-data-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,9 @@ Store = Service.extend({

if (DEBUG) {
this._trackedAsyncRequests = [];
this._trackAsyncRequestStart = (label) => {
let trace = 'set `store._generateStackTracesForTrackedRequests = true;` to get a detailed trace for where this request originated';
this._trackAsyncRequestStart = label => {
let trace =
'set `store._generateStackTracesForTrackedRequests = true;` to get a detailed trace for where this request originated';

if (this._generateStackTracesForTrackedRequests) {
try {
Expand All @@ -240,13 +241,13 @@ Store = Service.extend({

let token = Object.freeze({
label,
trace
trace,
});

this._trackedAsyncRequests.push(token);
return token;
};
this._trackAsyncRequestEnd = (token) => {
this._trackAsyncRequestEnd = token => {
let index = this._trackedAsyncRequests.indexOf(token);

if (index !== -1) {
Expand All @@ -260,8 +261,8 @@ Store = Service.extend({
let isSettled = tracked.length === 0;

if ((this.isDestroying || this.isDestroyed) && !isSettled) {
throw new Error('Async Request leaks detected:\n\t - ' +
tracked.map(o => o.label).join('\n\t - ')
throw new Error(
'Async Request leaks detected:\n\t - ' + tracked.map(o => o.label).join('\n\t - ')
);
}

Expand Down

0 comments on commit 471771a

Please sign in to comment.