refactor(appview): create event handler registry to eliminate duplication (#12)
Replace 18 nearly-identical event handler registrations in FirehoseService
with a declarative registry pattern. This eliminates boilerplate and makes
adding new collections easier.
Changes:
- Add EventHandlerRegistry class with fluent interface
- Refactor FirehoseService to use registry for handler setup
- Derive wantedCollections from registered handlers
- Add comprehensive unit tests for registry
Benefits:
- DRY compliance: Single place to configure collection handlers
- Easier to maintain: Clear declaration-based configuration
- Simpler to extend: Adding a collection now requires one .register() call
- Better testability: Registry can be tested independently
The setupEventHandlers() method went from 86 lines of repetitive code
to 12 lines that apply the registry and set up cursor/error handlers.