-
Notifications
You must be signed in to change notification settings - Fork 1
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
useLoadable #44
Comments
See also #24 |
This is done, I can transfer ownership but want to hear what the thoughts are in #24 first. |
cc @jamiebuilds @fouad @jamesplease thoughts? |
I like this but 1. Rename to There are a few other 2. Output order should be I can understand open to pushback/other ideas! |
I'll rename to loadable, I also think switching the order is a good idea 🙌 I'm a little on the fence about It makes me think that adding some separate hooks might be better than increasing the scope of this one. anyways - appreciate the feedback and will update this thread once I've updated the code on my end! |
np! maybe @jamiebuilds will have a useful opinion on |
@fouad sort of torn on adding the timeout functionality to I'd rather defer the module consumer add some sort of composition on their end
You can check out the code here if you're curious how it would work: I've also updated the repo with the other changes from above: |
You also need to provide boolean props like For example we have several HTTP delete requests, that don't return anything on success. Of course I could refactor our API layer to always |
I love how GraphQL
<QueryRender />
have render props that returnI often find myself writing the same logic around form submit buttons and other various UI where I need to know whether my async function is loading, had an error or the result.
I'm proposing an API like this:
I think we should also support a
delayMs
option that will tell our async function only resolve after a given ms .. it should work like this:I have most of the code working, I'll just need to add type defintions and some better testing in this repo: https://github.com/hanford/async-function
Once that's done, I'll transfer the ownership (aiming to be complete tomorrow morning)
The text was updated successfully, but these errors were encountered: