refactor(GetFonts): centralize filterManager/sortStore → fontStore bridge

Move the duplicated $effect blocks that mapped filterManager and sortStore
into fontStore params out of Search, FontSearch and FilterControls into a
single $effect.root in features/GetFonts/model/state/bindings.svelte.ts.

Consumers now bind to the manager/store directly; the bridge is installed
once via a side-effect import from the feature barrel.
This commit is contained in:
Ilia Mashkov
2026-05-24 15:05:28 +03:00
parent 1573950605
commit e60309af78
5 changed files with 46 additions and 30 deletions
@@ -3,12 +3,10 @@
Provides a search input and filtration for fonts
-->
<script lang="ts">
import { fontStore } from '$entities/Font';
import {
FilterControls,
Filters,
filterManager,
mapManagerToParams,
} from '$features/GetFonts';
import { springySlideFade } from '$shared/lib';
import {
@@ -16,7 +14,6 @@ import {
SearchBar,
} from '$shared/ui';
import SlidersHorizontalIcon from '@lucide/svelte/icons/sliders-horizontal';
import { untrack } from 'svelte';
import { cubicOut } from 'svelte/easing';
import {
Tween,
@@ -34,11 +31,6 @@ interface Props {
let { showFilters = $bindable(true) }: Props = $props();
$effect(() => {
const params = mapManagerToParams(filterManager);
untrack(() => fontStore.setParams(params));
});
const transform = new Tween(
{ scale: 1, rotate: 0 },
{ duration: 250, easing: cubicOut },