{"size": 884, "ext": "js", "max_stars_repo_path": "src/redux/phoneBook/phonebook-action.js", "max_stars_repo_name": "EclipsoZhuk/goit-react-hw-06-phonebook", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/redux/phoneBook/phonebook-action.js", "max_issues_repo_name": "EclipsoZhuk/goit-react-hw-06-phonebook", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/redux/phoneBook/phonebook-action.js", "max_forks_repo_name": "EclipsoZhuk/goit-react-hw-06-phonebook", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.5555555556, "max_line_length": 82, "alphanum_fraction": 0.5972850679}
// import { ADD_CONTACT, DELETE_CONTACT, FILTER_CHANGE } from './phonebook-types';
// import { v4 as uuidv4 } from 'uuid';

// export const addContact = (name, number) => ({
//     type: ADD_CONTACT,
//     payload: {
//         id: uuidv4(),
//         name,
//         number,
//     },
// });

// export const deleteContact = idContact => ({
//     type: DELETE_CONTACT,
//     payload: idContact,
// });

// export const changeFilter = idContact => ({
//     type: FILTER_CHANGE,
//     payload: idContact,
// });

import { createAction, nanoid } from '@reduxjs/toolkit';

export const addContact = createAction('phonebook/Add', ({ name, number }) => ({
    payload: {
        id: nanoid(),
        name: name,
        number: number,
    },
}));

export const deleteContact = createAction('phonebook/Delete');

export const changeFilter = createAction('phonebook/filterChange');
