MCPcopy Create free account
hub / github.com/TanStack/hotkeys / resetInstance

Method resetInstance

packages/hotkeys/src/key-state-tracker.ts:97–102  ·  view source on GitHub ↗

* Resets the singleton instance. Useful for testing.

()

Source from the content-addressed store, hash-verified

95 /** Read once, since mousemove reads lock state many times a second. */
96 #mac = detectPlatform() === 'mac'
97 /** Lock key states, published with the next held key or lock change. */
98 #locks = unknownLocks()
99 /** Window listeners as `[type, listener, capture]`, removed together on destroy. */
100 #listeners: Array<[string, EventListener, boolean]> = []
101
102 private constructor() {
103 this.#setupListeners()
104 }
105

Callers

nothing calls this directly

Calls 1

destroyMethod · 0.45

Tested by

no test coverage detected