From 7915dd65e00842ba2466cab9168c19f796c54b77 Mon Sep 17 00:00:00 2001 From: othree Date: Tue, 20 Aug 2024 15:54:27 +0900 Subject: [PATCH] feat: supports async callback --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index ff8c353..e70b8c8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import { AppState, AppStateStatus } from 'react-native'; import { useFocusEffect, useNavigation } from '@react-navigation/native'; type EffectCleanup = undefined | void | (() => void); -type EffectCallback = () => EffectCleanup; +type EffectCallback = () => EffectCleanup | Promise; const cleanupIfNeeded = (cleanup: RefObject) => { if (cleanup && cleanup.current && typeof cleanup.current === 'function') {