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
Nesta página do site você pode assistir ao vídeo on-line Observer Pattern - Design Patterns in JavaScript duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário TomDoesTech 24 Março 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 8,355 vezes e gostou 256 espectadores. Boa visualização!