<commit_before>import React, { Component } from 'react';
import { connect } from 'react-redux';
import { selectBook } from '../actions/index';
import { bingActionCreators } from 'redux';



class BookList extends Component {
    renderList() {
        return this.props.books.map((book) => {
            return (
            <li key={book.title} className="list-group-item">{book.title}</li>
            );
        });
    }
    
    render() {
        return (
            <ul className="list-group col-sm-4">
                {this.renderList()}
            </ul>
        )
    }
}

function mapStateToProps(state) {
    // Whatever is returned from here
    // shows up as props inside of BookList
    return {
        books: state.books
    };
}

// Anything returned from teh function will end up as props
// on the BookList container

function mapDispatchToProps(dispatch) {
    // Whenever selectBook is called, the result should be passed 
    // to all of our reducers

    return bingActionCreators({ selectBook: selectBook }, dispatch);
}

// Promote BookList from a component to a container - it needs to know 
// about this new dispatch method selectBook. Make it available 
// as a prop.
export default connect(mapStateToProps, mapDispatchToProps)(BookList);<commit_msg>Revert "mapped actions to dispatch"<commit_after>import React, { Component } from 'react';
import { connect } from 'react-redux';



class BookList extends Component {
    renderList() {
        return this.props.books.map((book) => {
            return (
            <li key={book.title} className="list-group-item">{book.title}</li>
            );
        });
    }
    
    render() {
        return (
            <ul className="list-group col-sm-4">
                {this.renderList()}
            </ul>
        )
    }
}

function mapStateToProps(state) {
    // Whatever is returned from here
    // shows up as props inside of BookList
    return {
        books: state.books
    };
}

export default connect(mapStateToProps)(BookList);
{'fraction_non_alphanumeric': 0.11451135241855874, 'fraction_numerical': 0.0009871668311944718, 'mean_word_length': 2.274636510500808, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '3598492', 'n_tokens_mistral': 569, 'n_tokens_neox': 562, 'n_words': 165}