Skip to content

Instantly share code, notes, and snippets.

View sunwukung's full-sized avatar

Marcus Kielly sunwukung

View GitHub Profile
@sunwukung
sunwukung / kefir dom stream
Last active August 29, 2015 14:12
kefir event listener question
// domStreams
var K = require("kefir")
, exported = {}
, evts = ["click", "mouseenter", "mousemove", "mouseexit"];
evts.forEach((eventKey, i, arr) => {
exported[eventKey] = (elem) => {
return K.fromEvent(elem, eventKey);
};
});
@sunwukung
sunwukung / nodejs-loader.js
Last active December 20, 2015 17:59
wraps require to enable the injection of mocks
/*
module loader
primary purpose is to provide a way of
injecting mocks into nodeJS modules
secondary purpose is to eliminate relative
paths in require statements
*/