<commit_before>import {Observable as O} from 'rx';

import {preventDefault, stopPropagation} from '../../lib/utils';

export default (DOM) => {
  const rect = DOM.select('.test-rect');
  const rectRotate = DOM.select('.rotate-rect');

  const click$ = O.merge(
    rect
      .events('click')
      .do(stopPropagation)
      .do(preventDefault)
      .ignoreElements(),
    rect
      .events('mousedown')
      .do(preventDefault)
      .do(stopPropagation)
  );

  const rotate$ = O.merge(
    rectRotate
      .events('click')
      .do(stopPropagation)
      .do(preventDefault)
      .ignoreElements(),
    rectRotate
      .events('mousedown')
      .do(preventDefault)
      .do(stopPropagation)
  );

  return {
    rotate$: rotate$.map(() => true),
    click$: click$.map(() => true),
  };
};
<commit_msg>add touch handling for rectangle buttons<commit_after>import {Observable as O} from 'rx';

import {preventDefault, stopPropagation} from '../../lib/utils';

export default (DOM) => {
  const rect = DOM.select('.test-rect');
  const rectRotate = DOM.select('.rotate-rect');

  const click$ = O.merge(
    rect
      .events('click')
      .do(stopPropagation)
      .do(preventDefault)
      .ignoreElements(),
    rect
      .events('mousedown')
      .do(preventDefault)
      .do(stopPropagation),
    rect
      .events('tap', (manager, Hammer) => {
        manager.add(new Hammer.Tap());
      })
  );

  const rotate$ = O.merge(
    rectRotate
      .events('click')
      .do(stopPropagation)
      .do(preventDefault)
      .ignoreElements(),
    rectRotate
      .events('mousedown')
      .do(preventDefault)
      .do(stopPropagation),
    rectRotate
      .events('tap', (manager, Hammer) => {
        manager.add(new Hammer.Tap());
      })
  );

  return {
    rotate$: rotate$.map(() => true),
    click$: click$.map(() => true),
  };
};

{'fraction_non_alphanumeric': 0.16711301553294056, 'fraction_numerical': 0.0, 'mean_word_length': 2.5513307984790874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2460801', 'n_tokens_mistral': 602, 'n_tokens_neox': 601, 'n_words': 119}