import React from "react"; import { connect } from "react-redux"; import { SELECT_ALL, SELECT_ZERO, INVERT_SELECTION } from "../../actionTypes"; import PlaylistMenu from "./PlaylistMenu"; import { Dispatch } from "../../types"; interface DispatchProps { invertSelection: () => void; selectZero: () => void; selectAll: () => void; } const SelectionMenu = (props: DispatchProps) => (
); const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { return { invertSelection: () => dispatch({ type: INVERT_SELECTION }), selectAll: () => dispatch({ type: SELECT_ALL }), selectZero: () => dispatch({ type: SELECT_ZERO }), }; }; export default connect( null, mapDispatchToProps )(SelectionMenu);