fix: ensure action function returns object (#9848)

pull/9847/head
Dominic Gannaway 1 year ago committed by GitHub
parent 4717d2ad23
commit 56d8c0fd3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ensure action function returns object

@ -2148,7 +2148,7 @@ export function action(dom, action, value_fn) {
const value = value_fn(); const value = value_fn();
untrack(() => { untrack(() => {
if (payload === undefined) { if (payload === undefined) {
payload = action(dom, value); payload = action(dom, value) || {};
} else { } else {
const update = payload.update; const update = payload.update;
if (typeof update === 'function') { if (typeof update === 'function') {

Loading…
Cancel
Save