-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: singleton downloader #2190
base: fix-ci
Are you sure you want to change the base?
refactor: singleton downloader #2190
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but this is not what we want.
The goal of this issue about a singleton is to:
- have a single object, initialized once and for all, so that all calls have the same settings throughout the codebase ; here you've made all settings public and writable which means that we continue to have various behaviors ; maybe one or two settings must be tweakable at Downloader invocation, but then it means it is not a property of the object but a property of the invocation (function argument)
- stop passing downloader object in function invocation ; here you continue to pass the object instead of simply using the singleton in the function code (and importing this singleton in file obviously)
I apologize for the misunderstanding. I got it now. |
63e4df7
to
c14e1f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some general remarks:
- please remove all commented code, this is not needed in the long run and makes the PR hard to read.
- I'm very embarassed by the use of
#foo
private variable (in JS) ; while correct, it looks to me that most variable are declared withprivate foo
(private TS variable) and having a mix of both semantic is kinda weird. And I'm really not sure we need the safety of JS private variables. Plus I find the use of a private JS variable + a public getter very verbose compared to simply having apublic readonly foo
. Your views on this are welcomed.
@arjitcodes is this ready for a new review pass? |
Yes |
f92a0be
to
cf7e4ee
Compare
Rebased on what is supposed to be a fixed CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests are failing while they are not supposed to, can you please have a look (might be a temporary glitch, but better to confirm locally before running CI again).
fix: #2154
Implement a singleton pattern for the Downloader class.