Skip to content

Conversation

QuartzLibrary
Copy link
Contributor

This PR introduces a batch function that was present in an older version of leptos. It was removed because the new effects are deferred, so they are ~always batched.

Why is batch useful?
When using ImmediateEffects, you might want to modify multiple signals atomically to ensure all subscribers always see a consistent view.
This can come up because of application invariants that are hard or inconvenient to encode in the type system, to avoid excessive updates, or under certain design patterns like applying multiple edit operations to a signal tree.

In general, normal effects should still be preferred.

@gbj
Copy link
Collaborator

gbj commented Oct 10, 2025

Awesome, thanks for reintroducing this and for the test.

@gbj gbj merged commit 62d8ec9 into leptos-rs:main Oct 10, 2025
287 checks passed
@QuartzLibrary QuartzLibrary deleted the immediate-effect branch October 10, 2025 17:44
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