mirror of
https://github.com/block/buzz.git
synced 2026-10-31 22:41:12 +00:00
Split the 427-line-over-ratchet readStateManager.ts by moving the
drain-path logic (drainPendingIntents, markChannelUnreadDirect,
markChannelReadDirect, markChannelUnread, markChannelRead) into a new
readStateDrain.ts module. The manager methods become thin delegations
that cast `this` to the DrainContext interface.
readStateDrain.ts exports a DrainContext interface (the public subset of
ReadStateManager state and methods needed for drain operations) and five
standalone functions that implement the Amendment A/B/C drain semantics
verbatim — no behavior change.
File-size ratchet (merge-base 2ea938501):
readStateManager.ts: 959 → 1000 (allowed 1000) ✓
readStateDrain.ts: 0 → 313 (new file, ≤1000) ✓
useUnreadChannels.ts: 1021 → 1021 (allowed 1021) ✓
Tests: 4566/4566 ✓ tsc --noEmit clean ✓
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>