import React from 'react';
import {connect} from 'react-redux';

import {filterGreetings} from './selectors';

const Counter = ({greetings, filteredGreetings}) => (
    <div className="Counter">Showing {filteredGreetings.length} of {greetings.length} Greetings</div>
);

export default connect(
    state => ({
        greetings: state.greetings,
        filteredGreetings: filterGreetings(state.greetings, state.filter)
    })
)(Counter);
import React from 'react';
import {connect} from 'react-redux';

import {filterGreetings} from './selectors';

const Counter = ({greetingCount, filteredGreetingsCount}) => (
    <div className="Counter">Showing {filteredGreetingsCount} of {greetingCount} Greetings</div>
);

export default connect(
    state => ({
        greetingCount: state.greetings.length,
        filteredGreetingsCount: filterGreetings(state.greetings, state.filter).length
    })
)(Counter);
Determine counter numbers in connect
Determine counter numbers in connect
