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

Await blocks with no dynamic content behave incorrectly #1417

Closed
Rich-Harris opened this issue May 5, 2018 · 0 comments · Fixed by #1418
Closed

Await blocks with no dynamic content behave incorrectly #1417

Rich-Harris opened this issue May 5, 2018 · 0 comments · Fixed by #1418
Labels

Comments

@Rich-Harris
Copy link
Member

REPL. When you click the button, a new block is created; the old one reverts to its pending state and stays in the DOM.

<button on:click='updatePromise()'>click me</button>

{#await promise}
  <p>loading...</p>
{:then value}
  <p>loaded</p> <!-- change this to `loaded {value}` and it works correctly -->
{:catch error}
  <p>errored</p>
{/await}

<script>
  export default {
    data: () => ({
      promise: new Promise(f => setTimeout(() => f(42), 1000))
    }),
		
    methods: {
      updatePromise() {
        this.set({
          promise: new Promise(f => setTimeout(() => f(99), 1000))
        });
      }
    }
  };
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant