If I compose some methods with factory function below.
function createCrudMethods() {
return {
findMany: async () => {
},
findOne: async () => {
},
createOne: async () => {
},
deleteOne: async () => {
},
updateOne: async () => {
},
};
}
Can I do something like this?
const object = {
...createCrudMethods();
createOneWithNumber() {
// do some cool stuff
createOne() // error undefined
}
}
or maybe there is a better way to do this?