Skip to content

Commit d89d6e2

Browse files
docs: expand on async Svelte in Remote Functions (#14228)
* Update 60-remote-functions.md * Apply suggestion from @eltigerchino * Apply suggestion from @eltigerchino * Apply suggestion from @eltigerchino * Apply suggestion from @eltigerchino * Update documentation/docs/20-core-concepts/60-remote-functions.md --------- Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Rich Harris <[email protected]>
1 parent 1d04a77 commit d89d6e2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

documentation/docs/20-core-concepts/60-remote-functions.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Remote functions are a tool for type-safe communication between client and serve
1010

1111
Combined with Svelte's experimental support for [`await`](/docs/svelte/await-expressions), it allows you to load and manipulate data directly inside your components.
1212

13-
This feature is currently experimental, meaning it is likely to contain bugs and is subject to change without notice. You must opt in by adding the `kit.experimental.remoteFunctions` option in your `svelte.config.js`:
13+
This feature is currently experimental, meaning it is likely to contain bugs and is subject to change without notice. You must opt in by adding the `kit.experimental.remoteFunctions` option in your `svelte.config.js` and optionally, the `compilerOptions.experimental.async` option to use `await` in components:
1414

1515
```js
1616
/// file: svelte.config.js
@@ -20,6 +20,11 @@ const config = {
2020
experimental: {
2121
+++remoteFunctions: true+++
2222
}
23+
},
24+
compilerOptions: {
25+
experimental: {
26+
+++async: true+++
27+
}
2328
}
2429
};
2530

@@ -90,6 +95,8 @@ While using `await` is recommended, as an alternative the query also has `loadin
9095
const query = getPosts();
9196
</script>
9297

98+
<h1>Recent posts</h1>
99+
93100
{#if query.error}
94101
<p>oops!</p>
95102
{:else if query.loading}

0 commit comments

Comments
 (0)