Documentation / @etherfold/browser / PORT_PUSH_SUBSCRIPTIONS
Variable: PORT_PUSH_SUBSCRIPTIONS ​
constPORT_PUSH_SUBSCRIPTIONS:object
Defined in: packages/browser/src/host/envelope.ts:760
WHICH PAIR OF CASES TURNS EACH PUSH ON AND OFF, declared ONCE beside the push map itself.
A push is SUBSCRIBED TO and never broadcast, so every one of them has a subscribe/unsubscribe pair of cases (named for what they subscribe to, on the same ground the four reads are four cases). This states that pairing as DATA because a second place has to know it: a SharedWorker is handed a wire per client, so the filter that decides WHICH clients a push goes to lives in that shape (sharedWorker.ts) and would otherwise be a hand-written list of case names drifting one push behind this map.
A later push adds a key to PortPushes, its own pair of cases, and one line here -- and the satisfies below is what makes forgetting the line a compile error rather than a tab that subscribes and is never posted to.
Type Declaration ​
progress ​
readonlyprogress:object
progress.subscribe ​
readonlysubscribe:"subscribeToProgress"='subscribeToProgress'
progress.unsubscribe ​
readonlyunsubscribe:"unsubscribeFromProgress"='unsubscribeFromProgress'
stateMoved ​
readonlystateMoved:object
stateMoved.subscribe ​
readonlysubscribe:"subscribeToStateMoved"='subscribeToStateMoved'
stateMoved.unsubscribe ​
readonlyunsubscribe:"unsubscribeFromStateMoved"='unsubscribeFromStateMoved'