Closed melvincarvalho closed 1 year ago
Current implementation:
updateDownloadLink() { const inputSlug = document.getElementById("file-name").value; const downloadLink = document.getElementById("download"); let filename; filename = inputSlug; const path = getPath(serverUrl, userPublicKey, filename, mode); downloadLink.setAttribute("href", path); }
Suggested improvement:
updateDownloadLink() { const filename = document.getElementById("file-name").value; const downloadLink = document.getElementById("download"); const path = getPath(serverUrl, userPublicKey, filename, mode); downloadLink.setAttribute("href", path); }
The suggested refactor removes unnecessary variable assignments, making the function more concise and easier to read.
Current implementation:
Suggested improvement:
The suggested refactor removes unnecessary variable assignments, making the function more concise and easier to read.