PR pixi-reels

SpinOptions

pixi-reels


pixi-reels / index / SpinOptions

Interface: SpinOptions

Defined in: config/types.ts:8

Options accepted by reelSet.spin(options?). All fields are optional. passing nothing reproduces the legacy “every reel spins” behaviour.

Properties

PropertyTypeDescriptionDefined in
holdReels?number[]Reel indices to HOLD this spin. Held reels skip START / SPIN / STOP entirely and stay on whatever symbols they’re currently showing. They count as already-landed for the spin:allLanded resolver. only non-held reels actually animate. Use cases: - Hold & Win respins (most reels held, one or two reroll) - Sticky / expanding wilds during a feature spin - Bonus respin where the trigger column stays in place Notes: - setResult(grid) still expects a full reelCount-length grid; entries at held indices are ignored. Pass anything (including the held reels’ current visible rows). the engine doesn’t read held columns. - setAnticipation([...]) silently filters held indices. - setStopDelays([...]) entries at held indices are ignored. - The resolved SpinResult.symbols is the full visible grid AFTER the spin lands. held reels contribute their unchanged rows, non-held reels contribute their landed rows. - No spin:reelLanded / spin:stopping event fires for held reels. - Big-symbol blocks crossing held into non-held reels are not supported. the engine doesn’t reposition or reshape held reels to accommodate them. Author results that keep big symbols inside a contiguous run of non-held reels. - Indices outside [0, reelCount) and duplicate entries are silently filtered.config/types.ts:44
mode?"standard" | "cascade"Phase chain selector for this spin. 'cascade' requires .tumble(...) on the builder.config/types.ts:13
signal?AbortSignalAbort the spin from the outside. If this signal aborts before the reels land, the spin() promise REJECTS — with signal.reason when it is an Error, otherwise a generic abort error — and the reels are force-stopped to a clean grid. Wire this to the same AbortController that cancels the spin’s server request so a failed or cancelled fetch can never leave the reels spinning forever.config/types.ts:54
timeoutMs?numberWatchdog ceiling, in milliseconds. If the reels have not landed within timeoutMs of spin() starting (i.e. setResult() / requestSkip() / slamStop() was never called), the spin() promise REJECTS and the reels are force-stopped to a clean grid. Off by default — the engine imposes no timeout. Opt in for defence in depth against an integration whose error path forgets to settle the spin. Values <= 0 are ignored.config/types.ts:66