-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
33 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function isPlainObject(value: unknown): value is Record<string, unknown> { | ||
return typeof value === "object" && value !== null && !Array.isArray(value); | ||
} | ||
|
||
export function buildQueryKey(value: unknown) { | ||
if (Array.isArray(value)) { | ||
return value; | ||
} | ||
|
||
if (isPlainObject(value)) { | ||
return Object.entries(value).flat(); | ||
} | ||
|
||
return [value]; | ||
} |
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 |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import { Stack } from "expo-router"; | ||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
export default function Layout() { | ||
return ( | ||
<Stack> | ||
<Stack.Screen | ||
name="(tabs)" | ||
options={{ | ||
headerShown: false, | ||
}} | ||
/> | ||
</Stack> | ||
<QueryClientProvider client={queryClient}> | ||
<Stack> | ||
<Stack.Screen | ||
name="(tabs)" | ||
options={{ | ||
headerShown: false, | ||
}} | ||
/> | ||
</Stack> | ||
</QueryClientProvider> | ||
); | ||
} |