-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Change signature for GetNextPageArg
Also make LoadNextPageAsync return result, and throw if unable to fetch next page.
- Loading branch information
Showing
7 changed files
with
407 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace Phetch.Blazor.Tests.UseEndpointInfinite; | ||
|
||
public record PageResponse(int? NextCursor); |
6 changes: 6 additions & 0 deletions
6
test/Phetch.Blazor.Tests/UseEndpointInfinite/UseEndpointInfiniteTestContent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@using Phetch.Blazor.Experimental | ||
|
||
@code { | ||
[Parameter, EditorRequired] | ||
public UseEndpointInfiniteContext<int, PageResponse> Context { get; set; } = null!; | ||
} |
16 changes: 16 additions & 0 deletions
16
test/Phetch.Blazor.Tests/UseEndpointInfinite/UseEndpointInfiniteTests.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@using Phetch.Blazor.Experimental | ||
@inherits TestContext | ||
|
||
@code { | ||
RenderFragment EndpointFragment1(Endpoint<int, PageResponse> endpoint, int arg) | ||
{ | ||
return @<UseEndpointInfinite | ||
Endpoint="endpoint" | ||
GetNextPageArg="pages => (pages[^1].Data!.NextCursor ?? 0, pages[^1].Data!.NextCursor is not null)" | ||
Arg="arg" | ||
Options="new()" | ||
> | ||
<UseEndpointInfiniteTestContent Context="@context"/> | ||
</UseEndpointInfinite>; | ||
} | ||
} |
Oops, something went wrong.