Skip to content

Commit 2686789

Browse files
authored
docs: correct .refresh() example (#14090)
Seems like `.refresh()` returns a Promise and if you are not awaiting it the single-flight mutation does not work. Adding the await makes it work so might just be a typo in docs.
1 parent bb6fc44 commit 2686789

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export const createPost = form(async (data) => {
270270

271271
// Refresh `getPosts()` on the server, and send
272272
// the data back with the result of `createPost`
273-
+++getPosts().refresh();+++
273+
+++await getPosts().refresh();+++
274274

275275
// Redirect to the newly created page
276276
redirect(303, `/blog/${slug}`);

0 commit comments

Comments
 (0)