<commit_before>import Rx from 'rx';
import {h} from '@cycle/dom';

export function labeledSlider(responses) {
  function intent(DOM) {
    return {
      newValue: DOM.select('.slider').events('input')
        .map(ev => ev.target.value)
    };
  }

  function model({props}, {newValue}) {
    const initialValue$ = props.get('initial').first(),
          value$ = initialValue$.concat(newValue),
          props$ = props.getAll();

    return Rx.Observable
      .combineLatest(props$, value$, (props, value) => ({props, value}));
  }

  function view(state$) {
    return state$.map(({props, value}) => {
      const {label, unit, min, max} = props;
      return h('div.labeled-slider', [
        h('span.label', [label + ' ' + value + unit]),
        h('input.slider', {type: 'range', min, max, value})
      ]);
    });
  }

  const actions = intent(responses.DOM),
        DOM = view(model(responses, actions));

  const {newValue} = actions;

  return {
    DOM,
    events: {
      newValue
    }
  };
}<commit_msg>And another name bites the dust<commit_after>import Rx from 'rx';
import {h} from '@cycle/dom';

export function labeledSlider(responses) {
  function intent(DOM) {
    return {
      newValue: DOM.select('.slider').events('input')
        .map(ev => ev.target.value)
    };
  }

  function model({props}, {newValue}) {
    const initialValue$ = props.get('initial').first(),
          value$ = initialValue$.concat(newValue),
          props$ = props.getAll();

    return Rx.Observable
      .combineLatest(props$, value$, (props, value) => ({props, value}));
  }

  function view(state$) {
    return state$.map(({props, value}) => {
      const {label, unit, min, max} = props;
      return h('div.labeled-slider', [
        h('span.label', [label + ' ' + value + unit]),
        h('input.slider', {type: 'range', min, max, value})
      ]);
    });
  }

  const events = intent(responses.DOM),
        DOM = view(model(responses, events));

  return {DOM, events};
}
{'fraction_non_alphanumeric': 0.17912694430506773, 'fraction_numerical': 0.0, 'mean_word_length': 2.8199233716475094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5311866', 'n_tokens_mistral': 643, 'n_tokens_neox': 625, 'n_words': 145}