Skip to content

Commit

Permalink
Simplify the NetworkManager.prototype.requestRange method
Browse files Browse the repository at this point in the history
Thanks for modern JavaScript we don't need to "manually" build the arguments object.
  • Loading branch information
Snuffleupagus committed Dec 31, 2024
1 parent 61c3ed4 commit 57e7a3e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/display/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,7 @@ class NetworkManager {
}

requestRange(begin, end, listeners) {
const args = {
begin,
end,
};
for (const prop in listeners) {
args[prop] = listeners[prop];
}
return this.request(args);
return this.request({ begin, end, ...listeners });
}

requestFull(listeners) {
Expand Down

0 comments on commit 57e7a3e

Please sign in to comment.