We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
that Traversal have a filterWithIndex in addition to filter
filterWithIndex
filter
A non-behavior because the feature does not exist.
I would like Traversal<S,A> to have filterWithIndex: <I>(f: Predicate<I>) => (sa:Traversal<S,A>) => Traversal<S,A>
Traversal<S,A>
filterWithIndex: <I>(f: Predicate<I>) => (sa:Traversal<S,A>) => Traversal<S,A>
I still am trying to figure out how the traversal code works, so I can't provide a suggested solution (yet). Is it theoretically possible/desired?
Motivating use case: I'm porting some old, very convoluted code over to a more functional style and at one point it has something like
let spec = {} Object.keys(obj).forEach(k => { if(['description', 'value', 'type'].indexOf(k) === -1) { spec[k] = obj[k].map(mappingFunction) } })
It seems this would be nice:
const spec = objectTraversal .filterWithIndex((k,v) => ['description','value','type'].indexOf(k)===-1) .modify(mappingFunctioN)
The text was updated successfully, but these errors were encountered:
Note: I meant PredicateWithIndex<A> not Predicate<I>
PredicateWithIndex<A>
Predicate<I>
Sorry, something went wrong.
No branches or pull requests
馃殌 Feature request
that Traversal have a
filterWithIndex
in addition tofilter
Current Behavior
A non-behavior because the feature does not exist.
Desired Behavior
I would like
Traversal<S,A>
to havefilterWithIndex: <I>(f: Predicate<I>) => (sa:Traversal<S,A>) => Traversal<S,A>
Suggested Solution
I still am trying to figure out how the traversal code works, so I can't provide a suggested solution (yet). Is it theoretically possible/desired?
Who does this impact? Who is this for?
Additional context
Motivating use case: I'm porting some old, very convoluted code over to a more functional style and at one point it has something like
It seems this would be nice:
The text was updated successfully, but these errors were encountered: