Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thenable store #88

Open
SamMousa opened this issue Nov 2, 2023 · 0 comments
Open

Thenable store #88

SamMousa opened this issue Nov 2, 2023 · 0 comments

Comments

@SamMousa
Copy link

SamMousa commented Nov 2, 2023

Currently the Loadable implementation introduces a new type and requires extra syntax:

{#await myLoadableStore.load()}
 <p>Currently loading...</p>
{:then}
 <p>Your loaded data is: {$myLoadableStore}</p>
{/await}

What about just making the store itself implement .then() ie making it a Thenable.
The syntax would then look like this:

{#await myLoadableStore}
 <p>Currently loading...</p>
{:then}
 <p>Your loaded data is: {$myLoadableStore}</p>
{/await}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant