43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
export async function deleteItemAsync(key: string): Promise<void> {
|
|
return localStorage.removeItem(key)
|
|
}
|
|
|
|
export function getItem(key: string): string | null {
|
|
return localStorage.getItem(key)
|
|
}
|
|
|
|
export async function getItemAsync(key: string): Promise<string | null> {
|
|
return localStorage.getItem(key)
|
|
}
|
|
|
|
export function setItem(key: string, value: string): void {
|
|
localStorage.setItem(key, value)
|
|
}
|
|
|
|
export async function setItemAsync(key: string, value: string): Promise<void> {
|
|
localStorage.setItem(key, value)
|
|
}
|
|
|
|
/**
|
|
import AsyncStorage from '@react-native-async-storage/async-storage'
|
|
|
|
export async function deleteItemAsync(key: string): Promise<void> {
|
|
return AsyncStorage.removeItem(key)
|
|
}
|
|
|
|
export function getItem(key: string): string | null {
|
|
return Promise.apply(AsyncStorage.getItem(key))
|
|
}
|
|
|
|
export async function getItemAsync(key: string): Promise<string | null> {
|
|
return AsyncStorage.getItem(key)
|
|
}
|
|
|
|
export function setItem(key: string, value: string): void {
|
|
AsyncStorage.setItem(key, value)
|
|
}
|
|
|
|
export async function setItemAsync(key: string, value: string): Promise<void> {
|
|
return AsyncStorage.setItem(key, value)
|
|
}
|
|
*/ |