square / svelte-store

529 stars 35 forks source link

feat: safeLoad function for catching load errors #11

Closed Akolyte01 closed 2 years ago

Akolyte01 commented 2 years ago

This PR adds a 'safeLoad' function that can be used to catch load errors

example usage

{#await safeLoad(myStore) then success}
  {#if !success}
    <ErrorBanner/>
  {/if}
  <ComponentContent>
{/await}