<commit_before>import React from 'react'
import { connect } from 'react-redux'
import { dispatch } from '@rematch/core'

// Make a presentational component.
// It knows nothing about redux or rematch.
const App = ({ count, asyncIncrement, increment }) => (
  <div>
    <h2>count is <b style={{ backgroundColor: '#ccc' }}>{count}</b></h2>
    
    <h2>
      <button onClick={increment}>Increment count</button>
    {' '}
    <em style={{ backgroundColor: 'yellow' }}>(normal dispatch)</em>
    </h2>

    <h2>
    <button onClick={asyncIncrement}>Increment count (delayed 1 second)</button>
    {' '}
    <em style={{ backgroundColor: 'yellow' }}>(an async effect!!!)</em>
    </h2>
  </div>
)

// Use react-redux's connect
export default connect(state => ({
  count: state.count,
  increment: dispatch.count.increment,
  asyncIncrement: dispatch.count.asyncIncrement,
}))(App)
<commit_msg>update react example to use mapDispatch<commit_after>import React from 'react'
import { connect } from 'react-redux'

// Make a presentational component.
// It knows nothing about redux or rematch.
const App = ({ count, asyncIncrement, increment }) => (
  <div>
    <h2>count is <b style={{ backgroundColor: '#ccc' }}>{count}</b></h2>
    
    <h2>
      <button onClick={increment}>Increment count</button>
    {' '}
    <em style={{ backgroundColor: 'yellow' }}>(normal dispatch)</em>
    </h2>

    <h2>
    <button onClick={asyncIncrement}>Increment count (delayed 1 second)</button>
    {' '}
    <em style={{ backgroundColor: 'yellow' }}>(an async effect!!!)</em>
    </h2>
  </div>
)

const mapState = state => ({
  count: state.count,
})

const mapDispatch = dispatch => ({
  increment: dispatch.count.increment,
  asyncIncrement: dispatch.count.asyncIncrement,
})

// Use react-redux's connect
export default connect(mapState, mapDispatch)(App)

{'fraction_non_alphanumeric': 0.1675704989154013, 'fraction_numerical': 0.007592190889370932, 'mean_word_length': 3.84251968503937, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 44, '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': '7463377', 'n_tokens_mistral': 595, 'n_tokens_neox': 590, 'n_words': 159}