feat(displayedFontsStore): create store to manage displayed fonts sample and its content

This commit is contained in:
Ilia Mashkov
2026-01-18 14:55:00 +03:00
parent e0e0d929bb
commit f457e5116f
4 changed files with 25 additions and 0 deletions

View File

View File

@@ -0,0 +1 @@
export { displayedFontsStore } from './store';

View File

@@ -0,0 +1,23 @@
import { selectedFontsStore } from '$entities/Font';
export class DisplayedFontsStore {
#sampleText = $state('The quick brown fox jumps over the lazy dog');
#displayedFonts = $derived.by(() => {
return selectedFontsStore.all;
});
get fonts() {
return this.#displayedFonts;
}
get text() {
return this.#sampleText;
}
set text(text: string) {
this.#sampleText = text;
}
}
export const displayedFontsStore = new DisplayedFontsStore();

View File

@@ -0,0 +1 @@
export { displayedFontsStore } from './displayedFontsStore.svelte';