-
Notifications
You must be signed in to change notification settings - Fork 61
How to show a spinner during queries fetching and how to refresh queries themselves? #13
Comments
You can pass a React element as the
Call |
@RickWong do you mind adding an ability to set emptyView during createContainer (for example, in options)? So the container itself will have an ability to specify what view should be rendered during query fetching? |
Actually, I do have an opinion on this matter. See if any component must decide whether to render an empty view, then it should be the parent component. Because A) The Transmit container should only care about fetching queries into props to pass down, or being in the process of doing that. It should be as transparent as possible. B) The child component should only be tasked with rendering the query results that it knows about. It doesn't know anything about spinners, I do hope. Putting it differently: How does a pizza smell? Like pizza. How does the box containing pizza smell? Like pizza. But how does an empty box smell? Like cardboard. So the cleanest solution is to create a Spinner component and pass that as |
Thanks for explaining your idea - makes sense. Regarding rerunning the query: I've a use case when I need to implement a 'refresh' button that will rerun the query (now I know how) and also it must display spinner while the query is still executing. |
My issue with |
Thanks for exploring this feature. I think need to correct myself, and say that |
I tried creating HoC on top of react-transmit to use onQuery for providing 'isLoading' property to a wrapped react component like this:
I use it this way:
unfortunatly this doesn't work because react-transmit overwrittes onQuery when rendering wrapped component:
Is there any specific logic behind this? I need this property to show a spinner inside my react component when query is rerun and is still executing. |
I have two questions:
The text was updated successfully, but these errors were encountered: