Repository: https://github.com/TomDoesTech/js-des...
The observer pattern makes use of observable objects to make your code reactive. An observable is an object (the subject) that maintains a list of dependents (observers) and notifies them when the state changes, usually by calling a broadcast method.
An example of the observable pattern is EventTarget.addEventListener(). addEventListener allows you to subscribe to an event on the DOM and provide a callback function. When that event happens, your callback function will be executed.
0:00 Introduction
1:37 Create observable with a class
3:46 Using the observable
5:05 Observable factory function
6:08 Practical example
🌎 Follow me here:
Discord: / discord
Twitter: / tomdoes_tech
Facebook: / tomdoestech
Instagram: / tomdoestech
TikTok: / tomdoes_tech
☕ Buy me a coffee: https://www.buymeacoffee.com/tomn
Auf dieser Seite können Sie das Online-Video Observer Pattern - Design Patterns in JavaScript mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer TomDoesTech 24 März 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 8,355 Mal angesehen und es wurde von 256 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!