Lit adapter #55
fredericbahr
started this conversation in
General
Replies: 1 comment
-
|
Yep, we just forget about Lit a lot, since we don't have a regular contributor or Lit champion on the tanstack team. This would be welcome |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
as multiple other Tanstack projects also provide an adapter for Lit i was thinking that this could be benificial for Hotkeys as well.
What are your ideas/needs for this. I could not see them planned in the README.
API Design wise i would propose the following:
Core principles:
Decorators
Single Hotkey Decorator
@hotkey(hotkey: HotKey | RawHotkey, options?: HotkeyOptions): Registers a single hotkey that triggers a class methodHotkey Sequences
@hotkeySequence(sequence: (Hotkey | RawHotkey)[], options?: HotkeySequenceOptions): Registers a multi-step key sequence that triggers a class methodControllers
Decorators solve event registration.
Controllers solve reactive key state.
KeyHoldController
Tracks whether a specific key is currently held.
new KeyHoldController(host, key)HeldKeysController
Tracks all currently pressed keys.
new HeldKeysController(host)HotkeyRecorderController
Used for building user configurable hotkeys.
new HotkeyRecorderController(host, options?: HotkeyRecorderOptions)Let me know what you think about the API design and if im missing something.
I am happy to help implement/maintain this adapter.
Beta Was this translation helpful? Give feedback.
All reactions