Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Commit

Permalink
Remove need for a Symbol shim
Browse files Browse the repository at this point in the history
Babel transpiles for...of to ES6 Symbol, which is not supported on
Safari. Until we really need for___of, I refactored the code to avoid
adding the shim.

Closes marmelab/ng-admin#610
  • Loading branch information
fzaninotto committed Aug 24, 2015
1 parent 83bf97e commit f0a98f5
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions lib/Queries/ReadQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,26 +372,10 @@ class ReadQueries extends Queries {
return this._promisesResolver.empty();
}

let getOne = this.getOne.bind(this),
calls = [];

for (let id of ids) {
calls.push(getOne(entity, 'listView', id, entity.identifier().name()));
}
let calls = ids.map(id => this.getOne(entity, 'listView', id, entity.identifier().name()));

return this._promisesResolver.allEvenFailed(calls)
.then(responses => {
var records = [];
for (let response of responses) {
if (response.status == 'error') { // skip failed responses
continue;
}

records.push(response.result);
}

return records;
});
.then(responses => responses.filter(r => r.status != 'error').map(r => r.result));
}
}

Expand Down

0 comments on commit f0a98f5

Please sign in to comment.