type Props<T> = {
    onCreate: (element: T) => void;
    onChange: (element: T) => void;
    onDelete: (element: T) => void;
};

export function useCRUD<T>(props: Props<T>) {
    const onCreate = (element: T) => {
        props.onCreate(element);
    }
    const onChange = (element: T) => {
        props.onChange(element);

    }
    const onDelete = (element: T) => {
        props.onDelete(element);
    }

    return {onCreate, onChange, onDelete};
}