Skip to content

feat: add functional updater support to setValue#92

Merged
mfazekas merged 1 commit into
mainfrom
mfazekas/setter-updater-function-v2
Dec 17, 2025
Merged

feat: add functional updater support to setValue#92
mfazekas merged 1 commit into
mainfrom
mfazekas/setter-updater-function-v2

Conversation

@mfazekas
Copy link
Copy Markdown
Collaborator

Allows setValue to accept a function that receives the previous value, similar to React's setState pattern.

setValue((v) => (v ?? 0) + 5)

@mfazekas mfazekas force-pushed the mfazekas/setter-updater-function-v2 branch from 33edc2d to 4de845b Compare December 17, 2025 11:57
@mfazekas mfazekas marked this pull request as ready for review December 17, 2025 12:00
@mfazekas mfazekas requested a review from HayesGordon December 17, 2025 12:00
@mfazekas mfazekas enabled auto-merge (squash) December 17, 2025 12:04
Copy link
Copy Markdown
Contributor

@HayesGordon HayesGordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@mfazekas mfazekas merged commit a4a993a into main Dec 17, 2025
7 checks passed
@mfazekas mfazekas deleted the mfazekas/setter-updater-function-v2 branch December 17, 2025 13:50
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.

2 participants