weasel API - v0.8.0
    Preparing search index...

    Function scratchKey

    • Make a typed scratch key. Use module-level constants so the same key is shared by writer and reader.

      Namespace the name by behavior or feature to avoid collisions ('behavior.field' is a good convention). Two keys with the same name refer to the same slot at runtime — the type parameter is a compile-time contract, not a uniqueness guarantee.

      Type Parameters

      • T

      Parameters

      • name: string

      Returns ScratchKey<T>