Skip to content

feat: add bind/binding helpers and simplify React API#26

Open
zetlen wants to merge 2 commits intomainfrom
feat/shallower-ramp
Open

feat: add bind/binding helpers and simplify React API#26
zetlen wants to merge 2 commits intomainfrom
feat/shallower-ramp

Conversation

@zetlen
Copy link
Copy Markdown
Owner

@zetlen zetlen commented Jan 27, 2026

Summary

  • Add bind() for immediate one-liner bindings that return an unbind function
  • Add binding() config builder for use with variadic keymash() factory
  • Add useBind() React hook for single bindings with automatic cleanup
  • Make keymash() accept variadic binding args: keymash(binding(...), binding(...))
  • Remove setResult pattern from React hooks (handlers now use standard context)
  • Rewrite README with comprehensive docs: hold vs press, key reference, intermediate examples
  • Lead React docs with simplest useBind API first

Test plan

  • All 66 existing tests pass
  • New tests added for bind(), binding(), and useBind()
  • Build succeeds
  • Lint passes
  • Manual testing of autocomplete experience in IDE

🤖 Generated with Claude Code

Introduce a shallower learning curve with new ergonomic APIs:

- Add `bind()` for immediate one-liner bindings that return an unbind function
- Add `binding()` config builder for use with variadic `keymash()` factory
- Add `useBind()` React hook for single bindings with automatic cleanup
- Make `keymash()` accept variadic binding args: `keymash(binding(...), binding(...))`
- Remove setResult pattern from React hooks (handlers now use standard context)
- Rewrite README with comprehensive docs: hold vs press, key reference, intermediate examples
- Lead React docs with simplest `useBind` API first

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented Jan 27, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

- Hero example uses bind() one-liner instead of keymash() + km.bind()
- All vanilla JS examples use bind() or binding() + keymash()
- React section leads with useBind, then useKeymash for grouped bindings
- Remove setResult handler context example, show standard React state
- Update scoped example to show useBind with scope option

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant