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

angelozehr picture angelozehr  Â·  3Comments

thoughtspile picture thoughtspile  Â·  3Comments

Rich-Harris picture Rich-Harris  Â·  3Comments

Rich-Harris picture Rich-Harris  Â·  3Comments

davidcallanan picture davidcallanan  Â·  3Comments