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

    Interface KaylaCustomHookConfig<Return, Params>

    Configuration for a custom Kayla hook created via createUseHook.

    interface KaylaCustomHookConfig<Return, Params extends any[] = []> {
        onUse: (
            unsafeFiber: UnsafeKaylaFiber,
            global: GlobalKayla,
            ...params: Params,
        ) => Return;
        memoize?: boolean;
        name: string;
    }

    Type Parameters

    • Return
    • Params extends any[] = []
    Index

    Properties

    Properties

    onUse: (
        unsafeFiber: UnsafeKaylaFiber,
        global: GlobalKayla,
        ...params: Params,
    ) => Return

    Called when the hook is used (once if memoized, every render if not). Receives the current fiber, global context, and any runtime params passed to the hook.

    Type Declaration

    memoize?: boolean

    This Option is not going to work anymore.

    Whether to memoize (cache) the result of onUse across component refreshes.

    • true (default): runs onUse only once per entity lifetime → most common & performant
    • false: runs onUse on every render → useful for hooks that must recompute frequently
    true
    
    name: string

    Required name for this custom hook — used in dev-mode logs/warnings to identify it.