Closed Archmonger closed 1 year ago
@rmorshea I'm seeing some weird behavior that might indicate a bug with async use_effect
hooks.
Let me know when you have time for me to demo.
I'll have time in an hour.
Ops forgot to add async mutation support...
EDIT: Past me apparently already semi-developed it, but I'm not sure what direction to take for a thread_sensitive
parameter for mutations. I think we might need to create a MutationOptions
data type.
@rmorshea
Regarding a thread_sensitive
parameter for mutations, which approach do we want to take?
MutationOptions
data type with a thread_senstive
parameter.thread_sensitive
use_query
hookthread_sensitive=...
kwarg directly to use_mutation
use_query
I opted for use_mutation
with MutationOptions
since I think it's the only API that doesn't feel mismatched when comparing to use_query
with QueryOptions
.
We should re-evaluate when merging these hooks into core.
In the future, I'd like these settings to either be kwargs
or a TypeDict
(assuming editors start having TypeDict
auto completion)
This PR is ready for review.
I did a tabletop self-review and cleaned up a couple things.
Will try to find time. Going to be quite busy the next two weeks.
I played around with the test to get things running faster and more reliably.
@rmorshea Can we schedule a review for this one?
Description
fix https://github.com/reactive-python/reactpy-django/issues/135
thread_sensitive
where it's not neededuse_query
now supports async functions.use_mutation
now supports async functions.django_idom.types.QueryOptions.thread_sensitive
option to customize how sync queries are executed.django_idom.hooks.use_mutation
now acceptsdjango_idom.types.MutationOptions
option to customize how mutations are executed.kwarg
andargs
. This allow things such asquery=my_function
to be properly handled.mutate
argument ondjango_idom.hooks.use_mutation
has been renamed tomutation
.Checklist:
Please update this checklist as you complete each item: