Skip to content

docs: Use svelte for prismjs codeblocks #5727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/svelte/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The `@tanstack/svelte-query` package offers a 1st-class API for using TanStack Q

Include the QueryClientProvider near the root of your project:

```markdown
```svelte
<script lang="ts">
import { QueryClient, QueryClientProvider } from '@tanstack/svelte-query'
import Example from './lib/Example.svelte'
Expand All @@ -24,7 +24,7 @@ Include the QueryClientProvider near the root of your project:

Then call any function (e.g. createQuery) from any component:

```markdown
```svelte
<script lang="ts">
import { createQuery } from '@tanstack/svelte-query'

Expand Down
4 changes: 2 additions & 2 deletions docs/svelte/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Svelte uses a compiler to build your code which optimises rendering. By default,

In the below example, the `refetchInterval` option is set from the variable `intervalMs`, which is edited by the input field. However, as the query is not told it should react to changes in `intervalMs`, `refetchInterval` will not change when the input value changes.

```markdown
```svelte
<script lang="ts">
import { createQuery } from '@tanstack/svelte-query'

Expand All @@ -27,7 +27,7 @@ In the below example, the `refetchInterval` option is set from the variable `int

To solve this, you can prefix the query with `$: ` to tell the compiler it should be reactive.

```markdown
```svelte
<script lang="ts">
import { createQuery } from '@tanstack/svelte-query'

Expand Down
8 changes: 4 additions & 4 deletions docs/svelte/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The recommended way to achieve this is to use the `browser` module from SvelteKi

**src/routes/+layout.svelte**

```markdown
```svelte
<script lang="ts">
import { browser } from '$app/environment'
import { QueryClient, QueryClientProvider } from '@tanstack/svelte-query'
Expand Down Expand Up @@ -52,7 +52,7 @@ export const load: PageLoad = async () => {
```

**src/routes/+page.svelte**
```markdown
```svelte
<script>
import { createQuery } from '@tanstack/svelte-query'
import type { PageData } from './$types'
Expand Down Expand Up @@ -104,7 +104,7 @@ export const load: LayoutLoad = async () => {

**src/routes/+layout.svelte**

```markdown
```svelte
<script lang="ts">
import { QueryClientProvider } from '@tanstack/svelte-query'
import type { LayoutData } from './$types'
Expand Down Expand Up @@ -135,7 +135,7 @@ export const load: PageLoad = async ({ parent, fetch }) => {

**src/routes/+page.svelte**

```markdown
```svelte
<script lang="ts">
import { createQuery } from '@tanstack/svelte-query'

Expand Down