Core · interface

QueuedMessage

One transient message at a time, in priority order.

Explained in The loop.

interface QueuedMessage
import 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

NameTypeDescription
idreadonlystringIdentity, used to collapse a repeat of the same event.
priorityreadonlynumberHigher wins, both for ordering and for interrupting.
durationMsreadonlynumberHow long it holds the screen once current.