feat(state): add change listener suppression context manager#79
Conversation
53abedb to
97e1ed1
Compare
|
For information, I will add an additional commit to support the suppress change to the typed state as well (forgot to implement that) |
|
@jourdain I have kept two independent commits for the state / typed_state. Let me know if I should squash (or if you have any feedbacks on this PR of course! |
5c659be to
ee5101c
Compare
|
Seems good. I can't focus enough to follow all the details, but the code looks good to me. |
|
But you need to rebase and fix the conflicts. |
Adds a context manager to suppress change listener callbacks on the server in its scope. Allows to avoid unwanted backend callbacks when only a client state update is wanted.
Add suppress_change_listeners context manager to the TypedState to suppress any bound callback to any of the typed state field from being triggered in its context.
ee5101c to
a8f52a1
Compare
|
@jourdain, thx for the ping. For information, I have stumbled on a flakky test in trame-slicer and I'm checking to see if the suppress change can resolve it in practice. I'll let you know once I've run a few tests |
|
I'm ok to merge if you think it is good to go. But you will have to remove the "draft" state. |
|
After playing a while, my problem was unrelated to anything the supress_listener can solve... I think the PR is good to go as it is. |
Adds a context manager to suppress change listener callbacks on the server in its scope. Allows to avoid unwanted backend callbacks when only a client state update is wanted.