Skip to content

Commit

Permalink
Simplify the NetworkManager.prototype.requestRange method
Browse files Browse the repository at this point in the history
Thanks to modern JavaScript we don't need to "manually" build the arguments object.
  • Loading branch information
Snuffleupagus committed Dec 31, 2024
1 parent 61c3ed4 commit 303c6d9
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 303c6d9

Please sign in to comment.