Skip to content

Can exchanges debounce field mutations? #1255

Answered by kitten
arcanis asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think an additional layer makes much sense given that the state of modifications would have to be duplicated for such a simple case.

I'd opt for queueing up changes in local state and would just buffer or denounce them to combine them as needed or determine when it'd immediately have to be sent off as this would like be a small hook with a queue and a setTimeout attached to state changes.

It's totally possible to use an exchange too and I could cobble some code examples together here if you have some specific description of what needs to be sent ASAP vs denounced. But a wrapper around the mutation hook is likely much easier to achieve given that this sounds like a UI state Problem…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@arcanis
Comment options

@arcanis
Comment options

Answer selected by arcanis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants