{"action":"created","issue":{"url":"https://api.github.com/repos/bem/bem-core/issues/314","labels_url":"https://api.github.com/repos/bem/bem-core/issues/314/labels{/name}","comments_url":"https://api.github.com/repos/bem/bem-core/issues/314/comments","events_url":"https://api.github.com/repos/bem/bem-core/issues/314/events","html_url":"https://github.com/bem/bem-core/issues/314","id":23088447,"number":314,"title":"Концепт асинхронного API для bem-xjst","user":{"login":"narqo","id":88045,"avatar_url":"https://avatars.githubusercontent.com/u/88045?v=3","gravatar_id":"","url":"https://api.github.com/users/narqo","html_url":"https://github.com/narqo","followers_url":"https://api.github.com/users/narqo/followers","following_url":"https://api.github.com/users/narqo/following{/other_user}","gists_url":"https://api.github.com/users/narqo/gists{/gist_id}","starred_url":"https://api.github.com/users/narqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narqo/subscriptions","organizations_url":"https://api.github.com/users/narqo/orgs","repos_url":"https://api.github.com/users/narqo/repos","events_url":"https://api.github.com/users/narqo/events{/privacy}","received_events_url":"https://api.github.com/users/narqo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bem/bem-core/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-11-21T18:53:04Z","updated_at":"2015-01-29T19:30:51Z","closed_at":"2015-01-29T19:30:51Z","body":"cc @indutny @veged @dfilatov \r\n\r\nНасмотревшись на всякие [генераторы][1], [tamejs], [IcedCoffeeScript][2] и пр. [asjs] появилась идея попробовать поддержать всю эту асинхронщину на уровне компилятора и добавить к уже имеющимся `block()`, `elem()`, `mod()` и пр. `apply()` две функции \r\n\r\n* `async(cb)` — эдакай [co][co] (generator-based control-flow coroutines? :D);\r\n* `await(val)` — аналог `yield` в генераторах.\r\n\r\nГипотетический пример такого API: https://gist.github.com/narqo/bf7debec89a760e6b007\r\n\r\nВсе это могло бы на уровне компиллятора генерироваться в обычный промис или цепочку колбеков.\r\n\r\n[co]: https://github.com/visionmedia/co\r\n[1]: https://medium.com/code-adventures/174f1fe66127\r\n[tamejs]: https://github.com/maxtaco/tamejs\r\n[2]: http://maxtaco.github.io/coffee-script/\r\n[asjs]: https://github.com/omgtehlion/asjs"},"comment":{"url":"https://api.github.com/repos/bem/bem-core/issues/comments/72088270","html_url":"https://github.com/bem/bem-core/issues/314#issuecomment-72088270","issue_url":"https://api.github.com/repos/bem/bem-core/issues/314","id":72088270,"user":{"login":"veged","id":15365,"avatar_url":"https://avatars.githubusercontent.com/u/15365?v=3","gravatar_id":"","url":"https://api.github.com/users/veged","html_url":"https://github.com/veged","followers_url":"https://api.github.com/users/veged/followers","following_url":"https://api.github.com/users/veged/following{/other_user}","gists_url":"https://api.github.com/users/veged/gists{/gist_id}","starred_url":"https://api.github.com/users/veged/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veged/subscriptions","organizations_url":"https://api.github.com/users/veged/orgs","repos_url":"https://api.github.com/users/veged/repos","events_url":"https://api.github.com/users/veged/events{/privacy}","received_events_url":"https://api.github.com/users/veged/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T19:30:50Z","updated_at":"2015-01-29T19:30:50Z","body":"практика показывает, что это не особо актуально"}}