mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
reorg again, absolute (module) imports
This commit is contained in:
12
app/state/settings.ts
Normal file
12
app/state/settings.ts
Normal 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)
|
||||
})
|
||||
Reference in New Issue
Block a user