Utilisation du stockage navigateur local
This commit is contained in:
3
client/utils/SecureStore.native.ts
Normal file
3
client/utils/SecureStore.native.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import * as SecureStore from 'expo-secure-store'
|
||||
|
||||
export default SecureStore
|
17
client/utils/SecureStore.ts
Normal file
17
client/utils/SecureStore.ts
Normal file
@ -0,0 +1,17 @@
|
||||
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)
|
||||
}
|
||||
|
||||
export default { getItem, getItemAsync, setItem, setItemAsync }
|
Reference in New Issue
Block a user