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:
@@ -1,21 +1,12 @@
|
||||
<!--
|
||||
Component: Search
|
||||
Typeface search input for the comparison view.
|
||||
Updates the global filterManager query to filter the font list.
|
||||
Writes through filterManager; the global bridge in $features/GetFonts
|
||||
propagates the value into fontStore.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { fontStore } from '$entities/Font';
|
||||
import {
|
||||
filterManager,
|
||||
mapManagerToParams,
|
||||
} from '$features/GetFonts';
|
||||
import { filterManager } from '$features/GetFonts';
|
||||
import { SearchBar } from '$shared/ui';
|
||||
import { untrack } from 'svelte';
|
||||
|
||||
$effect(() => {
|
||||
const params = mapManagerToParams(filterManager);
|
||||
untrack(() => fontStore.setParams(params));
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="p-6 border-b border-black/5">
|
||||
|
||||
Reference in New Issue
Block a user