refactor settings to nanostores
This commit is contained in:
parent
ff99dbcd22
commit
b67b049802
11 changed files with 81 additions and 122 deletions
15
website/src/settings.mjs
Normal file
15
website/src/settings.mjs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { persistentMap } from '@nanostores/persistent';
|
||||
import { useStore } from '@nanostores/react';
|
||||
|
||||
export const defaultSettings = {
|
||||
keybindings: 'codemirror',
|
||||
theme: 'strudelTheme',
|
||||
fontFamily: 'monospace',
|
||||
fontSize: 18,
|
||||
};
|
||||
|
||||
export const settingsMap = persistentMap('strudel-settings', defaultSettings);
|
||||
|
||||
export function useSettings() {
|
||||
return useStore(settingsMap);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue