Skip to content

Comments

feat(atoms,react): improve StateHookTuple type to include Events generic#336

Open
bowheart wants to merge 1 commit intomasterfrom
josh/improve-state-hook-tuple-types
Open

feat(atoms,react): improve StateHookTuple type to include Events generic#336
bowheart wants to merge 1 commit intomasterfrom
josh/improve-state-hook-tuple-types

Conversation

@bowheart
Copy link
Collaborator

Summary

  • Updated StateHookTuple to include the Events generic parameter for better type safety
  • Modified ExportsInfusedSetter to accept Events generic and properly type the events parameter
  • Updated all overloads of useAtomState and injectAtomState to include the EventsOf<> type
  • Changed the setter function signature to use Partial<Events & ExplicitEvents> instead of any for the events parameter

Test plan

  • Verify TypeScript compilation passes without errors
  • Test that useAtomState and injectAtomState return properly typed tuples
  • Confirm that the setter function has correct event types

🤖 Generated with Claude Code

@bowheart bowheart force-pushed the josh/improve-state-hook-tuple-types branch from 4c457ef to ea35676 Compare February 20, 2026 14:45
@affects atoms, react

Updated StateHookTuple and ExportsInfusedSetter types to properly include the Events generic parameter, ensuring type safety when passing events to the setter function returned by useAtomState and injectAtomState.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bowheart bowheart force-pushed the josh/improve-state-hook-tuple-types branch from ea35676 to 6c0eb98 Compare February 23, 2026 17:33
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