24 lines
685 B
TypeScript
24 lines
685 B
TypeScript
// Metro module 12617 (f12618).
|
|
import useInitialValue from "./useInitialValue";
|
|
import { useUnmountEffect } from "./useMountEffect";
|
|
export default function useUnmountAbortSignal() {
|
|
let c19934_0;
|
|
const initialValue = useInitialValue(() => new AbortController());
|
|
c19934_0 = initialValue;
|
|
useUnmountEffect(() => {
|
|
c19934_0.abort();
|
|
});
|
|
return initialValue.signal;
|
|
};
|
|
export function useUnmountAbortSignalWithDelay(c19935_0) {
|
|
let c19935_1;
|
|
const initialValue = useInitialValue(() => new AbortController());
|
|
c19935_1 = initialValue;
|
|
useUnmountEffect(() => {
|
|
setTimeout(() => {
|
|
c19935_1.abort();
|
|
}, c19935_0);
|
|
});
|
|
return initialValue.signal;
|
|
}
|