use shorter store syntax

This commit is contained in:
Georgi Gardev
2023-11-19 11:22:56 +02:00
parent 4202893af9
commit e871b7bc18
2 changed files with 3 additions and 10 deletions

View File

@@ -35,20 +35,13 @@ export function Settings(props: SettingsProps) {
<Flex direction="column" gap=".5rem">
<Checkbox
checked={appSettings.showLocations}
onChange={(e) =>
setAppSettings((prev) => ({ ...prev, showLocations: (e.target as any).checked }))
}
onChange={(e) => setAppSettings({ showLocations: (e.target as any).checked })}
>
Show locations
</Checkbox>
<Checkbox
checked={appSettings.useSavedBackgrounds}
onChange={(e) =>
setAppSettings((prev) => ({
...prev,
useSavedBackgrounds: (e.target as any).checked,
}))
}
onChange={(e) => setAppSettings({ useSavedBackgrounds: (e.target as any).checked })}
>
Use favorited backgrounds
</Checkbox>

View File

@@ -1,4 +1,4 @@
import { Accessor, JSX, createContext, createMemo, useContext } from 'solid-js';
import { Accessor, JSX, createContext, useContext } from 'solid-js';
import { SetStoreFunction } from 'solid-js/store';
import { sample } from '~/lib/array';
import { createLocalStore } from '~/lib/create-local-store';