8000 Thenable store · Issue #88 · square/svelte-store · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Thenable store #88
Open
Open
@SamMousa

Description

@SamMousa

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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0