{"size": 878, "ext": "js", "max_stars_repo_path": "components/screens/AddInventoryReduxed.js", "max_stars_repo_name": "rsrthedarklord/track-inventory", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "components/screens/AddInventoryReduxed.js", "max_issues_repo_name": "rsrthedarklord/track-inventory", "max_issues_repo_issues_event_min_datetime": "2021-05-11T15:33:21.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-11T15:33:21.000Z", "max_forks_repo_path": "components/screens/AddInventoryReduxed.js", "max_forks_repo_name": "rsrthedarklord/track-inventory", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 25.0857142857, "max_line_length": 74, "alphanum_fraction": 0.6640091116}
import {connect} from 'react-redux';

import * as Actions from '../../actions/ActionTypes';
import AddInventory from './AddInventory';

const mapStateToProps = (state) => {
    return ({
        inventories : state.commonReducer.inventories
    });
};

const mapDispatchToProps = (dispatch) => ({
    addInventory: ({newInventory}) => {
        dispatch(addInventoryAction({newInventory}));
    },
    updateInventory: ({updatedInventory}) => {
        dispatch(updateInventoryAction({updatedInventory}));
    }
})

export const addInventoryAction = ({newInventory}) => {
    return {
        type: Actions.ADD_USER_NAME,
        newInventory
    };
}

export const updateInventoryAction = ({updatedInventory}) => {
    return {
        type: Actions.UPDATE_INVENTORY,
        updatedInventory
    };
}

export default connect(mapStateToProps, mapDispatchToProps)(AddInventory);