Skip to content

Commit fb10e20

Browse files
gh-action-runnergh-action-runner
authored andcommitted
Squashed 'apollo-ios-pagination/' changes from 71f8f0f0..73ec3fd3
73ec3fd3 [ApolloPagination] Declare canLoadPrevious and canLoadNext @atomic (#297) git-subtree-dir: apollo-ios-pagination git-subtree-split: 73ec3fd3c43c477b9a875d2f55367866e7759868
1 parent e43e277 commit fb10e20

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/ApolloPagination/GraphQLQueryPagerCoordinator.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class GraphQLQueryPagerCoordinator<InitialQuery: GraphQLQuery, PaginatedQuery: G
6464
Task { [weak self] in
6565
guard let self else { return }
6666
let (canLoadNext, canLoadPrevious) = await self.pager.canLoadPages
67-
self.canLoadNext = canLoadNext
68-
self.canLoadPrevious = canLoadPrevious
67+
self.$canLoadNext.mutate { $0 = canLoadNext }
68+
self.$canLoadPrevious.mutate { $0 = canLoadPrevious }
6969
}
7070
}
7171
await subscriptions.store(subscription: publishSubscriber)
@@ -89,9 +89,9 @@ class GraphQLQueryPagerCoordinator<InitialQuery: GraphQLQuery, PaginatedQuery: G
8989
}
9090

9191
/// Whether or not we can load the next page. Initializes with a `false` value that is updated after the initial fetch.
92-
var canLoadNext: Bool = false
92+
@Atomic var canLoadNext: Bool = false
9393
/// Whether or not we can load the previous page. Initializes with a `false` value that is updated after the initial fetch.
94-
var canLoadPrevious: Bool = false
94+
@Atomic var canLoadPrevious: Bool = false
9595

9696
/// Reset all pagination state and cancel all in-flight operations.
9797
func reset() {

0 commit comments

Comments
 (0)