Skip to content

Commit 7dc2019

Browse files
committed
lint
1 parent f584d0d commit 7dc2019

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/svelte/src/internal/client/reactivity/batch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export class Batch {
3939

4040
#pending = 0;
4141

42-
/** @type {PromiseWithResolvers<void> | null} */
42+
/** @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} */
43+
// TODO replace with Promise.withResolvers once supported widely enough
4344
deferred = null;
4445

4546
/** @type {Effect[]} */

packages/svelte/src/internal/client/runtime.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/** @import { ComponentContext, Derived, Effect, Reaction, Signal, Source, Value } from '#client' */
22
import { DEV } from 'esm-env';
3-
import { define_property, get_descriptors, get_prototype_of, index_of } from '../shared/utils.js';
3+
import {
4+
deferred,
5+
define_property,
6+
get_descriptors,
7+
get_prototype_of,
8+
index_of
9+
} from '../shared/utils.js';
410
import {
511
destroy_block_effect_children,
612
destroy_effect_children,
@@ -893,7 +899,7 @@ export async function tick() {
893899
* @returns {Promise<void>}
894900
*/
895901
export function settled() {
896-
return (Batch.ensure().deferred ??= Promise.withResolvers()).promise;
902+
return (Batch.ensure().deferred ??= deferred()).promise;
897903
}
898904

899905
/**

0 commit comments

Comments
 (0)