import AsyncStorage from '@react-native-async-storage/async-storage' ; export default { getItem : async < T > ( key , defaultValue ) => { const value = await AsyncStorage . getItem ( key ) ; if ( ! value ) { return defaultValue ; } return JSON . parse ( value ) as T ; } , removeItem : async ( key ) => { await AsyncStorage . removeItem ( key ) ; } , setItem : async < T > ( key , value ) => { await AsyncStorage . setItem ( key , JSON . stringify ( value ) ) ; } , } ;