highlight viewing pattern

This commit is contained in:
Jade (Rose) Rowland 2024-01-06 17:33:24 -05:00
parent 1bc86c359e
commit 02b9bd82cf
3 changed files with 43 additions and 15 deletions

View file

@ -28,6 +28,19 @@ export const defaultSettings = {
export const settingsMap = persistentMap('strudel-settings', defaultSettings);
//pattern that the use is currently viewing in the window
const $viewingPattern = persistentAtom('viewingPattern', '', { listen: false });
export function setViewingPattern(key) {
$viewingPattern.set(key);
}
export function getViewingPattern() {
return $viewingPattern.get();
}
export function useViewingPattern() {
return useStore($viewingPattern);
}
// active pattern is separate, because it shouldn't sync state across tabs
// reason: https://github.com/tidalcycles/strudel/issues/857
const $activePattern = persistentAtom('activePattern', '', { listen: false });