Skip to content

Commit

Permalink
Merge pull request #20 from soil-kt/keepalive-args-type
Browse files Browse the repository at this point in the history
Pass Minimal Interface Instead of SwrClient Argument in KeepAlive Composable
  • Loading branch information
ogaclejapan committed May 12, 2024
2 parents 142c8a2 + 31eb0e9 commit 772b159
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ fun rememberQueriesErrorReset(
@Composable
fun KeepAlive(
key: QueryKey<*>,
// TODO Use QueryClient instead of SwrClient
client: SwrClient = LocalSwrClient.current
client: QueryClient = LocalSwrClient.current
) {
val query = remember(key) { client.getQuery(key) }
LaunchedEffect(Unit) {
Expand All @@ -68,8 +67,7 @@ fun KeepAlive(
@Composable
fun KeepAlive(
key: InfiniteQueryKey<*, *>,
// TODO Use QueryClient instead of SwrClient
client: SwrClient = LocalSwrClient.current
client: QueryClient = LocalSwrClient.current
) {
val query = remember(key) { client.getInfiniteQuery(key) }
LaunchedEffect(Unit) {
Expand All @@ -88,8 +86,7 @@ fun KeepAlive(
@Composable
fun KeepAlive(
key: MutationKey<*, *>,
// TODO Use MutationClient instead of SwrClient
client: SwrClient = LocalSwrClient.current
client: MutationClient = LocalSwrClient.current
) {
val query = remember(key) { client.getMutation(key) }
LaunchedEffect(Unit) {
Expand Down

0 comments on commit 772b159

Please sign in to comment.