Skip to content

Commit

Permalink
Abort timeseries requests when useTimeSeries is unmounted
Browse files Browse the repository at this point in the history
  • Loading branch information
amarkensteijn authored and wkramer committed Nov 1, 2023
1 parent 14de682 commit ac3672e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/services/useTimeSeries/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ActionRequest, PiWebserviceProvider } from '@deltares/fews-pi-requests'
import { ref, shallowRef, toValue, watchEffect } from 'vue'
import { onUnmounted, ref, shallowRef, toValue, watchEffect } from 'vue'
import type { MaybeRefOrGetter, Ref } from 'vue'
import { absoluteUrl } from '../../lib/utils/absoluteUrl'
import { DateTime, Interval } from 'luxon'
Expand Down Expand Up @@ -154,6 +154,10 @@ export function useTimeSeries(
}
})

onUnmounted(() => {
controller.abort()
})

const shell = {
series,
isReady,
Expand Down

0 comments on commit ac3672e

Please sign in to comment.