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

Idea: await without defer #18

Open
lanwin opened this issue Sep 26, 2011 · 1 comment
Open

Idea: await without defer #18

lanwin opened this issue Sep 26, 2011 · 1 comment

Comments

@lanwin
Copy link

lanwin commented Sep 26, 2011

In node there is the convention that callbacks should be the last parameter of an function.

with that in mind, it would be possible to create a short await which translates:

await { foo.bar(100,defer ()); }

to:

await foo.bar(100);

It would think that it is also possible to detect which variables are used behind the await and pass them automatically to defer. That would make the whole pattern a lot more readable.

@ThiefMaster
Copy link

But what it someone wants to use it in his non-node jQuery app?

$.get('foo', defer(var response), 'json');

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