Svelte: {#await} with function returning a promise and state update inside

Created on 3 Apr 2019  Â·  6Comments  Â·  Source: sveltejs/svelte

Actually, I'm not sure how exactly describe it)))

REPL

bug

Most helpful comment

This is happening because load() gets called on every update. It should only get called once since load never changes

All 6 comments

This is happening because load() gets called on every update. It should only get called once since load never changes

@Rich-Harris Is this issue still actual?

It's still an issue, yeah — not just restricted to await blocks. Here's a repro of a similar issue from @njbotkin https://svelte.dev/repl/632519a45a454e5eb3dd091655a98fed?version=3.7.1

This is awesome, but svelte.dev/repl/632519a45a454e5eb3dd091655a98fed?version=3.9.1 (line 17) now gives an Unexpected token error for me? :(

That looks like the same issue as #3447.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AntoninBeaufort picture AntoninBeaufort  Â·  3Comments

1u0n picture 1u0n  Â·  3Comments

noypiscripter picture noypiscripter  Â·  3Comments

ricardobeat picture ricardobeat  Â·  3Comments

davidcallanan picture davidcallanan  Â·  3Comments