[]previous and next page

SlotSwap

The transition layer of one slot, from transitionHooks()?.slotSwap(...): it keeps the shown branch while a transition builds the next one (see slotSwap in concurrency.ts).

The transition layer of one slot, from transitionHooks()?.slotSwap(...): it keeps the shown branch while a transition builds the next one (see slotSwap in concurrency.ts).

Import#

ts
import type { SlotSwap } from "@shadow-js/core/extend";

Signature#

ts
interface SlotSwap<C extends SlotChoice> {
  /**
   * Runs one pass of the slot's memo for `choice`. True when a transition keeps the shown value. False
   * when the usual path follows: the branch on screen has been retired and `state.live` is cleared.
   */
  step(choice: C): boolean;
}

Members#

Name Type Description
C C extends SlotChoice
step step(choice: C): boolean Runs one pass of the slot's memo for choice. True when a transition keeps the shown value. False when the usual path follows: the branch on screen has been retired and state.live is cleared.