Skip to content
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

Add support for react 18 #10

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Add support for react 18 #10

wants to merge 4 commits into from

Conversation

jemmyw
Copy link
Contributor

@jemmyw jemmyw commented Oct 26, 2023

No description provided.

* Updates in the given callback are batched together and only trigger a single
* render.
*/
export async function batch<T>(fn: () => Promise<T>): Promise<T> {

Choose a reason for hiding this comment

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

just jumping in, FYI, React 18 now batches all updates, not just updates in event handlers. Might reduce the need for manual batching if it all boils down to setState calls

Copy link
Contributor Author

Choose a reason for hiding this comment

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

batch in this context means deferring observer updates for a set of async operations

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