<commit_before>query.buildEventCallback = _.curry(function(callback, node, event) {
  return callback(node, event);
});

query.watch = _.curry(function(event, callback, node) {
  node = query.node(node);
  query.unwrap(node).addEventListener(event, query.buildEventCallback(callback, node));
  return node;
});

query.unwatch = _.curry(function(event, callback, node) {
  node = query.node(node);
  query.unwrap(node).removeEventListener(event, query.buildEventCallback(callback, node));
  return node;
});

query.ready = _.partial(document.addEventListener)('DOMContentLoaded');
<commit_msg>Updating the events API.<commit_after>query.buildEventCallback = _.curry(function(callback, node, event) {
  return callback(node, event);
});

query.watch = _.curry(function(event, callback, node) {
  node = query.node(node);
  callback = query.buildEventCallback(callback, node);
  query.unwrap(node).addEventListener(event, callback);
  return function() {
    return query.unwrap(node).removeEventListener(event, callback);
  };
});

query.ready = _.partial(document.addEventListener)('DOMContentLoaded');

{'fraction_non_alphanumeric': 0.14972776769509982, 'fraction_numerical': 0.0, 'mean_word_length': 6.402684563758389, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7527559', 'n_tokens_mistral': 321, 'n_tokens_neox': 324, 'n_words': 59}