You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This gives more insight into the state of a fork and also gives you the ability to run another function in the context of the fork. SvelteKit needs this
Copy file name to clipboardExpand all lines: packages/svelte/types/index.d.ts
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -363,6 +363,18 @@ declare module 'svelte' {
363
363
* Discard the fork
364
364
*/
365
365
discard(): void;
366
+
/**
367
+
* Whether the fork has been committed
368
+
*/
369
+
isCommitted(): boolean;
370
+
/**
371
+
* Whether the fork has been discarded
372
+
*/
373
+
isDiscarded(): boolean;
374
+
/**
375
+
* Run a function within the forked context.
376
+
*/
377
+
run(fn: ()=>void): Promise<void>;
366
378
}
367
379
/**
368
380
* Returns an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that aborts when the current [derived](https://svelte.dev/docs/svelte/$derived) or [effect](https://svelte.dev/docs/svelte/$effect) re-runs or is destroyed.
0 commit comments