Core · interface
QueuedMessage
One transient message at a time, in priority order.
Explained in The loop.
interface QueuedMessageimport type { QueuedMessage } from '@driftengine/core';In depth
Games fire events in bursts — finishing a run can produce three at once — and three notifications stacked on top of each other is worse than one, because the player reads none of them. This holds the backlog and hands back a single current message, so the presentation layer never has to decide what to drop.
Pure state and no DOM: what a notification looks like is the game's, and the part with rules worth pinning down is which one is on screen.
Properties
| Name | Type | Description |
|---|---|---|
idreadonly | string | Identity, used to collapse a repeat of the same event. |
priorityreadonly | number | Higher wins, both for ordering and for interrupting. |
durationMsreadonly | number | How long it holds the screen once current. |