Add example account store (#7641)

* Add example account store

* Format
This commit is contained in:
Eric Bailey
2025-02-03 14:22:49 -06:00
committed by GitHub
parent d0ff6dcba0
commit 25991af722
2 changed files with 12 additions and 1 deletions
+8 -1
View File
@@ -1,6 +1,7 @@
import {MMKV} from 'react-native-mmkv'
import {Did} from '@atproto/api'
import {Device} from '#/storage/schema'
import {Account, Device} from '#/storage/schema'
export * from '#/storage/schema'
@@ -73,9 +74,15 @@ export class Storage<Scopes extends unknown[], Schema> {
*/
export const device = new Storage<[], Device>({id: 'bsky_device'})
/**
* Account data that's specific to the account on this device
*/
export const account = new Storage<[Did], Account>({id: 'bsky_account'})
if (__DEV__ && typeof window !== 'undefined') {
// @ts-ignore
window.bsky_storage = {
device,
account,
}
}
+4
View File
@@ -10,3 +10,7 @@ export type Device = {
}
trendingBetaEnabled: boolean
}
export type Account = {
searchTermHistory?: string[]
}