Skip to content

Instantly share code, notes, and snippets.



Created Feb 5, 2014
What would you like to do?
broken code
function *listen(el, evType) {
while (true)
yield function(cb) {
var fire = function(ev) {
el.removeEventListener(evType, fire);
cb(null, ev);
el.addEventListener(evType, fire);
var gens = require('gens');
function go(gen) {
gens(gen)(function(err) { if (err) throw err; });
go(function*() {
var clicks = listen(document.getElementById('search'), 'click');
while (true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.