Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created September 15, 2012 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/3727481 to your computer and use it in GitHub Desktop.
Save Raynos/3727481 to your computer and use it in GitHub Desktop.
var changes = events(document.querySelector("#query"), "change")
, values = map(changes, function(ev) {
return ev.target.value
})
, clears = filter(qs, function (e) {
return e === "CLEAR"
})
, queries = filter(qs, function (e) {
return e !== "CLEAR"
})
, els = map(queries, function (text) {
var li = document.createElement("li")
li.textContent = text
return li
})
forEach(clears, function () {
results.textContent = ""
})
forEach(els, partial(prepend, document.querySelector("#results")))
// Or
els.pipe(prependStream(document.querySelector("#results")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment