Refactor/reacrhitecture to fsd+ #49

Merged
ilia merged 70 commits from refactor/reacrhitecture-to-fsd+ into main 2026-06-03 09:55:47 +00:00
2 changed files with 14 additions and 5 deletions
Showing only changes of commit f3a10e38df - Show all commits
@@ -11,10 +11,14 @@ const sections = [
{ index: 102, title: 'Spacing' },
];
/** @type {HTMLDivElement} */
let container;
/** @type {HTMLDivElement | undefined} */
let container = $state();
onMount(() => {
if (!container) {
return;
}
for (const section of sections) {
const el = /** @type {HTMLElement} */ (container.querySelector(`[data-story-index="${section.index}"]`));
scrollBreadcrumbsStore.add({ index: section.index, title: section.title, element: el }, 96);
@@ -24,9 +24,14 @@
*/
export function splitArray<T>(array: T[], callback: (item: T) => boolean) {
return array.reduce<[T[], T[]]>(
([pass, fail], item) => (
callback(item) ? pass.push(item) : fail.push(item), [pass, fail]
),
([pass, fail], item) => {
if (callback(item)) {
pass.push(item);
} else {
fail.push(item);
}
return [pass, fail];
},
[[], []],
);
}