<commit_before>import makeOrganism from '../../../src'
import Calculator from '../components/Calculator'

export default makeOrganism(Calculator, {
  initial: ({ initialValue = 0 }) => ({ value: initialValue }),
  changeValue: (props, { target }) => ({ value }) => ({ value: parseInt(target.value, 10) }),
  double: () => ({ value }) => ({ value: value * 2 }),
  add3: () => ({ value }) => ({ value: value + 3 })
})
<commit_msg>Fix demo calculator<commit_after>import makeOrganism from '../../../src'
import Calculator from '../components/Calculator'

export default makeOrganism(Calculator, {
  initial: ({ initialValue = 0 }) => ({ value: initialValue }),
  changeValue: (props, { target }) => ({ value: parseInt(target.value, 10) || '' }),
  // Or more robust number input handling with fallback to previous value:
  // changeValue: (props, { target: { value: newValue } }) => ({ value: previousValue }) => ({
  //   value: newValue && (parseInt(newValue, 10) || previousValue)
  // }),
  double: () => ({ value }) => ({ value: value * 2 }),
  add3: () => ({ value }) => ({ value: value + 3 })
})

{'fraction_non_alphanumeric': 0.21545454545454545, 'fraction_numerical': 0.012727272727272728, 'mean_word_length': 3.7051282051282053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, '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': '1985585', 'n_tokens_mistral': 335, 'n_tokens_neox': 327, 'n_words': 90}