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

{:then} / {:catch} require whitespace but not an identifier for resolution/rejection value #1507

Closed
Conduitry opened this issue May 27, 2018 · 2 comments
Labels
awaiting submitter needs a reproduction, or clarification bug

Comments

@Conduitry
Copy link
Member

Using {:then} or {:catch} throws an error compiling, saying there is whitespace expected (after the then/catch). If whitespace is added, {:then } and {:catch } are accepted, and afaict things work fine with no identifier to store the resolution or rejection value in.

I'm not 100% clear on whether we want to allow identifier-less {:then} and {:catch} blocks (probably? It's not in the docs but I don't see the harm), but if so, we shouldn't be requiring whitespace.

@Conduitry Conduitry added bug awaiting submitter needs a reproduction, or clarification labels May 27, 2018
@kaisermann
Copy link
Member

kaisermann commented Jun 1, 2018

I'm making a dialog component that closes after a certain promise is resolved and changes its content based on the promise state. In this case, the resolved/rejected data is irrelevant:

<AsyncDialog {promise} duration={3000}>
  {#await promise}
    <span>Loading...</span>
  {:then}
    <span>Success!</span>
  {:catch}
    <span>Error :(</span>
  {/await}
</AsyncDialog>

Rich-Harris added a commit that referenced this issue Jul 15, 2018
allow {:then}/{:catch} to have no bound identifier
@Rich-Harris
Copy link
Member

Released 2.9.4 with the fix — thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter needs a reproduction, or clarification bug
Projects
None yet
Development

No branches or pull requests

3 participants