ChilliCream / ChilliCream/graphql-platform
Strawberry shake: Expose a bindable Loading property on a generated razor component
@michaelstaib is already working on this.
Since Jun 13, 2022.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Is your feature request related to a problem?
While combining AntBlazors table component with a generated strawberry razor component, I ran into the issue of not being able to properly forward when the table is reloading (e.g. due to different sorting/filtering/pagination).
<GetPopularPackagesRenderer Query="@_query">
<Content Context="data">
<input bind-Value="_query" />
<MyCustomComponent Loading="??"></MyCustomComponent>
</Content>
<Loading>
<h1>Loading...</h1>
</Loading>
</GetPopularPackagesRenderer>
@code {
string _query;
}
When _query changes, GetPopularPackagesRenderer fetches new data from the server. While this is happening, I would like to stay in the Loading state while being able to inform there that a new Load is taking place.
The solution you'd like
Expose Loading as a bindable property so that I can inform the downstream components that loading is going on. The above would then look something like the following:
<GetPopularPackagesRenderer Query="@_query" bind-Loading="_loading">
<Content Context="data">
<input bind-Value="_query" />
<MyCustomComponent Loading="@_loading"></MyCustomComponent>
</Content>
<Loading>
<h1>Initial loading...</h1>
</Loading>
</GetPopularPackagesRenderer>
@code {
bool _loading;
string _query;
}
Product
Strawberry Shake
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.