{#each Object.entries(links) as [name, link] (link)}
{ const keys = Object.keys(links); const currentIndex = keys.findIndex( (key) => links[key].href === data.pathname, ); const nextIndex = keys.findIndex( (key) => links[key] === link, ); shouldGoBack = nextIndex < currentIndex; console.log({ shouldGoBack }); goto(link.href); }} >
{name}
{/each}
{#key data.pathname}
{@render children()}
{/key}