I'm stuck on currying a function with many parameters. What I want to do is take the result of return function and pass it to the next functions.
What I want is similar to this
return this.function(
this.function(
this.function(this.data, this.filterCondition1),
this.filterCondition2),
this.filterCondition3
);
What it basically does is it takes some data, filters it by condition and then feeds it to the next filter that also takes in a second different condition
What I've tried is:
curryFunction(data, filter, filterFunction) =>{
const filteredData = filterFunction(data)
return helper( curryFilter, curryFunction) =>{
return curryFunction(filteredData, curryFilter, curryFunction)
}
}
However, this function returns a function at the end instead of a value. Basically, it's an infinite loop. How exactly would I go about solving this problem? Thanks