Skip to content

Instantly share code, notes, and snippets.

@laser
Last active August 29, 2015 14:06
Show Gist options
  • Save laser/6f92c9c0658990536397 to your computer and use it in GitHub Desktop.
Save laser/6f92c9c0658990536397 to your computer and use it in GitHub Desktop.
functional logging
function tag(label) {
return function(value) {
return [label, value];
};
}
Bacon.mergeAll(
connections.map(tag("connection")),
messages.map(tag("message")),
entries.map(tag("entry")),
funFact.map(tag("funFact"))
).onValues(function(label, value) {
myCustomLoggingFunction(label, value);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment