Skip to content

Commit

Permalink
fix code highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
russbiggs committed Dec 1, 2024
1 parent 505f86d commit 3c0cf58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/routes/solid-router/reference/response-helpers/reload.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ title: reload
Reload is a response helper built on top of [revalidate](/solid-router/reference/response-helpers/revalidate).
It will receive a cache key, or an array of cache keys, to invalidate those queries, and cause them to fire again.

```ts title="/actions/update-todo.ts"{4}
```ts title="/actions/update-todo.ts" {7}
import { action, reload } from "@solidjs/router";
import { putTodo, getTodo } from "../db";

const updateTodo = action(async (todo: Todo) => {
await putTodo(todo.id, todo);

return reload({ revalidate: getTodo.keyFor(id) });
return reload({ revalidate: getTodo.keyFor(id) });
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If you intend to re-fire the queries immediately, check the [reload](/solid-rout

The code below will revalidate the `getTodo` query with the cache key.

```ts title="/actions/update-todo.ts"{4}
```ts title="/actions/update-todo.ts" {6}
import { action, revalidate } from "@solidjs/router";

const updateTodo = action(async (todo: Todo) => {
Expand All @@ -26,7 +26,7 @@ To better understand how queries work, check the [query](/solid-router/reference

The `revalidate` function also accepts a second parameter to force the revalidation of the cache data.

```ts title="/actions/update-todo.ts"{4}
```ts title="/actions/update-todo.ts" {6}
import { action, revalidate } from "@solidjs/router";

const updateTodo = action(async (todo: Todo) => {
Expand Down

0 comments on commit 3c0cf58

Please sign in to comment.