*Returnsan[`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.
*
*Mustbecalledwhileaderivedoreffectisrunning.
*
*```svelte
*<script>
*import{getAbortSignal}from'svelte';
*
*let{id}=$props();
*
*asyncfunctiongetData(id){
*constresponse=awaitfetch(`/items/${id}`,{
*signal:getAbortSignal()
*});
*
*returnawaitresponse.json();
*}
*
*constdata=$derived(awaitgetData(id));
*</script>
*```
*/
exportfunctiongetAbortSignal(){
exportfunctiongetAbortSignal(){
if(active_reaction===null){
if(active_reaction===null){
thrownewError('TODO getAbortSignal can only be called inside a reaction');
thrownewError('TODO getAbortSignal can only be called inside a reaction');
*Returnsan[`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.
*
*Mustbecalledwhileaderivedoreffectisrunning.
*
*```svelte
*<script>
*import{getAbortSignal}from'svelte';
*
*let{id}=$props();
*
*asyncfunctiongetData(id){
*constresponse=awaitfetch(`/items/${id}`,{
*signal: getAbortSignal()
*});
*
*returnawaitresponse.json();
*}
*
*constdata=$derived(awaitgetData(id));
*</script>
*```
*/
exportfunctiongetAbortSignal():AbortSignal;
exportfunctiongetAbortSignal():AbortSignal;
/**
/**
*`onMount`,like[`$effect`](https://svelte.dev/docs/svelte/$effect), schedules a function to run as soon as the component has been mounted to the DOM.
*`onMount`,like[`$effect`](https://svelte.dev/docs/svelte/$effect), schedules a function to run as soon as the component has been mounted to the DOM.