Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
textBody(req, function(err, body) {
s_closed[body] = Bacon.fromEventTarget(res, "close").map(true).toProperty(false);
s_closed[body].onValue();
});
});
touchend(el) {
return Bacon.fromEventTarget(el, 'touchend');
},
click(el) {
return Bacon.fromEventTarget(el, 'click');
},
'use strict';
import Bacon from 'baconjs';
import keycode from 'keycode';
const EVENT_KEYUP = Bacon.fromEventTarget(document, 'keyup');
const EVENT_KEYDOWN = Bacon.fromEventTarget(document, 'keydown');
/**
* create EventStream from user input
*/
export default {
/**
* @param {String|Number} charKey
* @returns {EventStream}
*/
key(charKey) {
let keyCode = typeof charKey === 'string' ? keycode(charKey)
: charKey;
return EVENT_KEYUP.filter(keyCodeIs(keyCode));
},
/**
mousemove(el = document.body) {
return Bacon.fromEventTarget(el, 'mousemove');
},
resize() {
return Bacon.fromEventTarget(window, 'resize');
},
function resizeEventStream() {
return Bacon.fromEventTarget(window, 'resize').debounce(250);
}
'use strict';
import Bacon from 'baconjs';
import keycode from 'keycode';
const EVENT_KEYUP = Bacon.fromEventTarget(document, 'keyup');
const EVENT_KEYDOWN = Bacon.fromEventTarget(document, 'keydown');
/**
* create EventStream from user input
*/
export default {
/**
* @param {String|Number} charKey
* @returns {EventStream}
*/
key(charKey) {
let keyCode = typeof charKey === 'string' ? keycode(charKey)
: charKey;
return EVENT_KEYUP.filter(keyCodeIs(keyCode));
},
touchmove(el) {
return Bacon.fromEventTarget(el, 'touchmove');
},