Skip to content

Instantly share code, notes, and snippets.

@ketanbhatt
Created September 23, 2018 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ketanbhatt/41142ce95eddf53e02db59e510550bd2 to your computer and use it in GitHub Desktop.
Save ketanbhatt/41142ce95eddf53e02db59e510550bd2 to your computer and use it in GitHub Desktop.
Observer Pattern Blog: Code Snippets
class NewsGetterMachine(object):
def __init__(self):
self.news = None
def get_news():
return self.news
def news_flash():
news = self.get_news()
news_paper_a.update(news)
news_paper_b.update(news)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment