Last active
August 29, 2015 14:07
-
-
Save jonathantneal/bf784b92fe277e084783 to your computer and use it in GitHub Desktop.
EventStreams example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.xanthir.com/b4PV0 | |
var ctrlKeyStream = EventStream.listen(document, 'keydown').map(function (event) { | |
return event.ctrlKey; | |
}); | |
ctrlKeyStream.forEach(function (event) { | |
// do something when a key down event fires that involves the CTRL key being pressed | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment