Maneira imutável de excluir uma chave de um objeto

/* Returns object without the specified property
* Example: Cal.query = removeKey(Cal.query, 'AppointmentType');

*/

const removeKey = (obj, propToDelete) => {
const { [propToDelete]: deleted, ...objectWithoutDeletedProp } = obj;
return objectWithoutDeletedProp;
};