import { ADD_BOOK,EDIT_BOOK,DELETE_BOOK, SELECT_BOOK } from '../../modules/book'

export const addBook = (data) => (dispatch) => {
    dispatch({ type: ADD_BOOK,playload: data })
}

export const editBook = (index,data) => (dispatch) => {
    dispatch({type: EDIT_BOOK,playload: data, itemIndex: index})
}

export const deleteBook = (data) => (dispatch) => {
    dispatch({type: DELETE_BOOK,playload: data})
}

export const selectBook = (index) => (dispatch) => {
    dispatch({type: SELECT_BOOK, itemIndex: index})
}