← Back to PatternPip

OBSERVER / PRACTICE

One order.
A changing audience.

Build a subscription system. Predict who gets an update, watch it travel, and keep the right listeners connected.

YOUR MISSION

The order keeps moving. The display doesn’t stay open.

A customer display and an activity log both need updates. When the customer closes the display, the log must keep working. Build the connection, test it, then add an audit log without rewriting the publisher.

01 / BUILD THE CONNECTION

Make three design choices.

Choose a piece, then see how it changes the broadcast.

What should every listener receive?

Try your own design first. Hints and retries are unlimited.

02 / PREDICT · PUBLISH · OBSERVE

Watch the audience change.

Local simulation

Send one Packed event. Follow each listener’s independent reaction.

ORDER A104Waiting to publish{ orderId, status }
PUBLISHER

OrderTracker

Choose a broadcast0 subscriptions
Customer display
Ready to connectWaitingLast displayed status
Activity log
Ready to connectWaiting0 recorded events
Optional: tap the listeners you think will receive Packed.
Your choices drive the result. Predictions are optional.
See the code behind your design TypeScript

Callbacks run synchronously in registration order. This trace replays recorded execution; it does not send real messages or model network delays.

03 / TRANSFER THE IDEA

An audit log wants updates too.

Add AuditLog as another listener. Which parts need to change?

First pass both test cases with a publisher that uses subscriptions.

Select all required edits

Compare with a complete solution

No time limit and no attempt limit. Try another assembly, use a hint, or reveal the answer when it helps.