Explaining this concept in English is quite challenging, but here's what I'm aiming for:
const operations = {
store: (input: T): T => {
return input;
},
discard: (input: T): void => {
console.log(input);
}
}
In both functions within this object, you'll notice the presence of a generic parameter T.
How can I achieve this? What should be the type of operations
to facilitate this?