reorg again, absolute (module) imports

This commit is contained in:
austinried
2021-07-08 12:21:44 +09:00
parent a94a011a18
commit ea4421b7af
54 changed files with 186 additions and 251 deletions

12
app/state/settings.ts Normal file
View File

@@ -0,0 +1,12 @@
import { atom } from 'jotai'
import { AppSettings } from '@app/models/settings'
import atomWithAsyncStorage from '@app/storage/atomWithAsyncStorage'
export const appSettingsAtom = atomWithAsyncStorage<AppSettings>('@appSettings', {
servers: [],
})
export const activeServerAtom = atom(get => {
const appSettings = get(appSettingsAtom)
return appSettings.servers.find(x => x.id === appSettings.activeServer)
})