Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
remix-run-bot committed May 10, 2024
1 parent 9339801 commit 2e65318
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ In 2.9.2 we've enhanced the type-safety when opting into the `future.unstable_si
With this release we're introducing new functions to assist the type-inference when using single fetch - `defineLoader`/`defineAction` and their client-side counterparts `defineClientLoader` and nd `defineClientAction`. These are identity functions; they don't modify your loader or action at runtime. Rather, they exist solely for type-safety by providing types for args and by ensuring valid return types.

```ts
export let loader = defineLoader(({ request }) => {
export const loader = defineLoader(({ request }) => {
// ^? Request
return { a: 1, b: () => 2 };
// ^ type error: `b` is not serializable
Expand All @@ -200,7 +200,7 @@ Note that `defineLoader` and `defineAction` are not technically necessary for de

```ts
// this totally works! and typechecking is happy too!
export let loader = () => {
export const loader = () => {
return { a: 1 };
};
```
Expand Down
5 changes: 4 additions & 1 deletion packages/remix-deno/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

### Patch Changes

- Typesafety for single-fetch: `defineLoader`, `defineClientLoader`, `defineAction`, `defineClientAction` ([#9372](https://github.com/remix-run/remix/pull/9372), [#9404](https://github.com/remix-run/remix/pull/9404))
- Typesafety for single-fetch: `defineLoader`, `defineClientLoader`,
`defineAction`, `defineClientAction`
([#9372](https://github.com/remix-run/remix/pull/9372),
[#9404](https://github.com/remix-run/remix/pull/9404))
- Updated dependencies:
- `@remix-run/[email protected]`

Expand Down

0 comments on commit 2e65318

Please sign in to comment.