Skip to content

Commit

Permalink
fix: ensure action function returns object (#9848)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm authored Dec 7, 2023
1 parent 4717d2a commit 56d8c0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/old-mails-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: ensure action function returns object
2 changes: 1 addition & 1 deletion packages/svelte/src/internal/client/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ export function action(dom, action, value_fn) {
const value = value_fn();
untrack(() => {
if (payload === undefined) {
payload = action(dom, value);
payload = action(dom, value) || {};
} else {
const update = payload.update;
if (typeof update === 'function') {
Expand Down

1 comment on commit 56d8c0f

@vercel
Copy link

@vercel vercel bot commented on 56d8c0f Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

svelte-5-preview – ./sites/svelte-5-preview

svelte-5-preview-svelte.vercel.app
svelte-octane.vercel.app
svelte-5-preview-git-main-svelte.vercel.app
svelte-5-preview.vercel.app

Please sign in to comment.