From 4930fb13ce54e3aea4dd9445359663206e9f8ff8 Mon Sep 17 00:00:00 2001 From: Jcparkyn <51850908+Jcparkyn@users.noreply.github.com> Date: Sat, 25 Nov 2023 19:57:53 +1100 Subject: [PATCH] BREAKING CHANGE: Change signature for GetNextPageArg Also make LoadNextPageAsync return result, and throw if unable to fetch next page. --- .../Shared/InfinitePostList.razor | 2 +- .../Experimental/UseEndpointInfinite.razor.cs | 69 ++-- .../UseEndpointInfinite/PageResponse.cs | 3 + .../UseEndpointInfiniteTestContent.razor | 6 + .../UseEndpointInfiniteTests.razor | 16 + .../UseEndpointInfiniteTests.razor.cs | 325 ++++++++++++++++++ test/Phetch.Tests/MockQueryFunction.cs | 10 + 7 files changed, 407 insertions(+), 24 deletions(-) create mode 100644 test/Phetch.Blazor.Tests/UseEndpointInfinite/PageResponse.cs create mode 100644 test/Phetch.Blazor.Tests/UseEndpointInfinite/UseEndpointInfiniteTestContent.razor create mode 100644 test/Phetch.Blazor.Tests/UseEndpointInfinite/UseEndpointInfiniteTests.razor create mode 100644 test/Phetch.Blazor.Tests/UseEndpointInfinite/UseEndpointInfiniteTests.razor.cs diff --git a/samples/HackerNewsClient/Shared/InfinitePostList.razor b/samples/HackerNewsClient/Shared/InfinitePostList.razor index c6c2040..f41b28f 100644 --- a/samples/HackerNewsClient/Shared/InfinitePostList.razor +++ b/samples/HackerNewsClient/Shared/InfinitePostList.razor @@ -2,7 +2,7 @@ + GetNextPageArg="pages => (pages[^1].Arg?.GetNextPageArgs(), pages.Count < pages[^1].Data?.NbPages)">