Idea: await without defer #18

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

Comments

Projects
None yet
2 participants

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.

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