Skip to content

Make useAsyncIterState's setter accept a function as to calculate next state #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

shtaif
Copy link
Owner

@shtaif shtaif commented Jan 8, 2025

Make useAsyncIterState's setter function support passing a function to calculate the new state from the previous like React.useState's setter.

@shtaif shtaif changed the title Make useAsyncIterState's setter function support passing a function… Make useAsyncIterState's setter accept a function as to calculate next state Jan 8, 2025
… to calculate the new state from the previous
@shtaif shtaif force-pushed the use-async-iter-state-set-with-function branch from 2b333a5 to 9dffb8f Compare January 8, 2025 19:55
@shtaif shtaif marked this pull request as ready for review January 8, 2025 19:56
@shtaif shtaif self-assigned this Jan 8, 2025
@shtaif shtaif merged commit 392b2e9 into master Jan 8, 2025
6 checks passed
@shtaif shtaif deleted the use-async-iter-state-set-with-function branch January 8, 2025 20:51
shtaif pushed a commit that referenced this pull request Jan 9, 2025
## [0.6.0](v0.5.1...v0.6.0) (2025-01-09)

### Features

* **useAsyncIterState:** support for setting state with a function to calculate the new state from the previous ([#45](#45)) ([392b2e9](392b2e9))
* **useAsyncIterState:** support setting an initial value via an argument ([#46](#46)) ([08a664d](08a664d))
Copy link

github-actions bot commented Jan 9, 2025

🎉 This PR is included in version 0.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant