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

Different Syntax #1

Open
cpietsch opened this issue Aug 13, 2018 · 1 comment
Open

Different Syntax #1

cpietsch opened this issue Aug 13, 2018 · 1 comment

Comments

@cpietsch
Copy link

What about a syntax like that:

<div v-promise="todos">
    <p v-await>loading...</p>
    <TodoList v-resolve="data" :data="data" />
    <p v-reject="error">Uh oh, something went wrong: {{ error }}</p>
</div>
@bgschiller
Copy link
Owner

Hi @cpietsch,

I think something like that would be much nicer! I wrote a little bit about my thoughts on what it could look like in the README.

As far as I can tell, this would require a change to how templates are compiled. If that's right, it would have to be done as a patch to the Vue core library, and couldn't be done in a "user-space" library.

If you can think of a way to tackle it in a library, I'd be happy to talk it over with you. Or if you want to try preparing a PR for Vue, I'd say go for it! Probably a good idea to make sure we have buy-in from the Vue.js core team first, since it seems like it would be a breaking change (If someone already has a custom directive called v-promise, or one of the others).

Thanks,
-Brian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants