{ gameStore.removeAll(); boredState.update((n) => ({ ...n, loading: true })); return async ({ result }) => { boredState.update((n) => ({ ...n, loading: false })); // `result` is an `ActionResult` object if (result.type === 'error') { toast.send('Error!', { duration: 3000, type: ToastType.ERROR, dismissible: true }); await applyAction(result); } else if (result.type === 'success') { gameStore.removeAll(); gameStore.addAll(result?.data?.games); totalItems = result?.data?.totalCount; // toast.send('Sucess!', { duration: 3000, type: ToastType.INFO, dismissible: true }); await applyAction(result); } else { await applyAction(result); } }; }} > {#if showButton} {/if}
{#if $gameStore?.length > 0}

Games Found:

{#each $gameStore as game (game.id)} {/each}
{#if showPagination} {/if}
{:else if $boredState.loading}

Games Found:

{#each placeholderList as game, i} {/each}
{/if}