The Big Split 0 ▲ ronjeffries.com 123 days ago · Tech · hide · Fediverse post Hello, loves! I’m just gonna go for it. If it works, I’ll claim it, if not, there’s always reset. It works! Wow! I figure we’ll wind up with a view maker and a view. One issue that I see is the subscriptions. As things stand, a subscription is a function that the PubSub calls. Ideally, we might like to do the subscriptions in the view maker, but have them execute in the view itself. Let’s try that in a test. def subscribe_someone_else(self): pub_sub = PubSub() view = FakeView() pub_sub.subscribe('event', '', view.on_event) assert view.called is False pub_sub.publish('event', '') assert view.called is True class FakeView: def __init__(self): self.called = False def on_event(self, event): self.called = True So that test shows that we have subscribed the on_event method of FakeView to the ‘event’, as one would hope. Our subscriptions are currently a bit tricky: class DungeonView: def subscribe_to_remove_content(self, pub_sub): def callback(*, pub_sub, content):… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town