mtg/observable.py
2010-06-16 10:16:49 -04:00

8 lines
246 B
Python

class Observable(object):
def __init__(self):
self.subscribers = []
def subscribe(self, subscriber):
self.subscribers.append(subscriber)
def emit(self, *args):
for fn in self.subscribers:
fn(*args)