@kayelaa/canvas API - v0.2.15
    Preparing search index...

    Variable useShouldRefreshConst

    useShouldRefresh: (deps: KaylaState<any>[]) => void = ...

    Opt-in: skip full refresh unless one of the listed states has changed since last refresh.

    This hook MUST be called at the top level of a component function — never inside loops, conditions, nested functions, or callbacks. The call order of all hooks is strictly fixed across every refresh; reordering calls will corrupt internal state.

    Call once, after all relevant useState hooks. If none of the watched states changed → skips re-running component body, hooks, children.

    Type Declaration

      • (deps: KaylaState<any>[]): void
      • Parameters

        • deps: KaylaState<any>[]

          Array of useState handles to watch

        Returns void

    const health = useState(100);
    const level = useState(1);
    useShouldRefresh([health, level]);

    // now only refreshes when health or level actually changes