Check out this currying function I've implemented:
export interface NewIdeaCardSubmit {
title: string,
description: string,
categories: CategoryValues
}
const applyInputs = (title: string) =>
(description: string) =>
(categories: CategoryValues) => {
return ({
title: title,
description: description,
categories: categories
} as NewIdeaCardSubmit )
};
Is there an alternative way to specify the return type of applyInputs
function instead of using as
?
It would be helpful if we could do it like this:
const applyInputs = (title: string) => (description: string) => (categories: CategoryValues) => NewIdeaCardSubmit