Closed darseen closed 9 months ago
needsLoadOrRefresh()
Refactored the needsLoadOrRefresh() method for improved readability. The logic remains the same, but the code structure has been enhanced.
needsLoadOrRefresh() { if (!this.accessToken) { return true; } else if ((Date.now() + TOKEN_BUFFER) > this.expiresAt) { return true; } else { return false; } }
needsLoadOrRefresh() { return !this.accessToken || (Date.now() + TOKEN_BUFFER) > this.expiresAt; }
All tests have been executed, and the changes have passed successfully.
Kudos, no new issues were introduced!
0 New issues 0 Security Hotspots No data about Coverage 0.0% Duplication on New Code
See analysis details on SonarCloud
Thank you @Darseen :) confirmed that all test are passed.
Refactor
needsLoadOrRefresh()
methodChanges Made
Refactored the
needsLoadOrRefresh()
method for improved readability. The logic remains the same, but the code structure has been enhanced.Before
After
Testing
All tests have been executed, and the changes have passed successfully.