Комментарии:
Nice explenation but... All the design patterns should be presented in TypeScript. The key words like private, public, static, protected are crucial in my opinion. On the other hand, Everyone who has the TS knowledge should handle to add TS to your's code :) Thank You!
ОтветитьCan we say that some parts of state managers like Redux use the Singleton Pattern?
Just to make sure I understood the concept here...
Incident implementation. It should just be a module, not a class.
Ответитьthanks a lot for your efforts , i really appreciate that
ОтветитьThe person that decided this needed to be called a "singleton pattern" wasted a lot of time...
ОтветитьSingleton adalah 1 instance object sifatnya shared reaource sehingga bisa di pakai oleh object lain
ОтветитьYou are so handsome and smart. Clear explanation, thanks!
ОтветитьLove this explanation
ОтветитьVery well explained. Thank you 🙏🏾
Ответитьgreat explanation, thank you
Ответитьis there a video on Factory Design Pattern ?
ОтветитьIsn't a database just a singleton? Its a shared resource that can be used by many other processes for different purposes, instead of each of those processes having their own separate set of data. Am I wrong, or do people that don't like singletons not like databases either?
ОтветитьCan we use this instead of FancyLogger inside the constructor of FancyLogger?
ОтветитьO hooo 1K to Million sub
😻
Dope!
ОтветитьError: "To load an ES module, set "type": "module" in the package.json or use the .mjs extension."
ОтветитьHi Kyle, thanks for the video. I have a question regarding to this singleton pattern: what's the difference between using an instance 'logger' and using a 'static' class attribute in the class 'FancyLogger' to record the logs ?
Ответитьthanks, good, but not professional))
ОтветитьSuch a good example!! Thank you!
Ответитьso redux is singleton 🥲
Ответитьthanks
Ответитьyou are so handsome
ОтветитьHi, The implementation looks good but In order to verify that the singleton implementation is working correctly you need to instantiate the FancyLogger twice, in your current implementation the constructor is called only once.
Ответить❤
ОтветитьIs it a good idea to use singleton to simplify plugin methods, something like field.setValue(34); Then it's like a namespaced function where the plugin maker does not need to add new instances of the class.
ОтветитьGreat explanation, and thanks for the video, just have 1 question, is it really necessary to do this manipulations inside constructor, if we import instance of logger it will be same instance for any file because of modules that are singletones anyway? Just wondering why we really need that checks here?
Ответитьto the point and really understandable! love it! keep up those great contents!
ОтветитьThanks for such a great explanation!
ОтветитьI paused video and tried something first and then I finished your video and saw it was much different.. Does anyone know the pros and cons of my version?
let L;
class Logger { ... }
if (!L) {
L = new Logger();
}
module.exports = L;
Is there something wrong with this version? I did this in Node and because Node caches all uses of require, I figured this was okay.
You have got 0.1% dislikes on your video, that is insane.
ОтветитьWe can also create a singleton via a factory function instead of doing it inside class constructor.
That's much cleaner imo.
Sometimes I wonder where I would be without you. 🙏🙏🙏
Ответитьkhankir pola kisui boji nai
ОтветитьNow I know how mongoose works behind the scenes.
Ответитьholy shit 0 dislikes. imma dislike it ahahhaahah jk bro ur awesome
Ответить.....
ОтветитьMost of the NPM modules (major ones) uses this pattern, e.g: Mongoose. This pattern is one of the best if anyone is creating a library or something like that as you might need to output some debug information for the module. Great video thanks a lot....BTW thanks for changing your uniform
ОтветитьAngular services are singleton by default, so I guess this pattern does have its niche
ОтветитьOhshhhh, this is llifechanging. Thanks a lot.
ОтветитьThank y
ОтветитьLed Zeppelin
Ответитьyour videos are awesome! thank you so much!!
Ответитьawesome videos!! Keep them coming
ОтветитьWhat is strategy pattern? Make a video on this. Thanks
ОтветитьJust wow! these days i was just looking for how to share class modules with other user objects. Just wow!
ОтветитьWhy export an instance variable? Wouldn't it be the same if first and second file just call new, which would return the same instance and then move Object.freeze into the constructor? Thinking it would be a cleaner solution
ОтветитьHi, very good video. We have always seen the "Singleton" pattern applied to a DB Connection class, what do you think ... do you think it is correct to apply it in this case?
Ответитьthank'u
Ответить