mirror of https://github.com/sveltejs/svelte
parent
726b3f1b85
commit
39179583c4
@ -0,0 +1,15 @@
|
|||||||
|
import { active_reaction, invocation_version } from '../runtime.js';
|
||||||
|
|
||||||
|
export function getAbortSignal() {
|
||||||
|
if (active_reaction === null) {
|
||||||
|
throw new Error('TODO');
|
||||||
|
}
|
||||||
|
|
||||||
|
var controller = (active_reaction.ctrl ??= new AbortController());
|
||||||
|
|
||||||
|
if (active_reaction.iv > invocation_version) {
|
||||||
|
controller.abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
return controller.signal;
|
||||||
|
}
|
Loading…
Reference in new issue