Comments (5)
you might be looking for https://remedajs.com/docs/#mapWithFeedback
(it's not quite that, but it can be easily built from that)
from remeda.
I'm looking for something like that, yes. Specifically I am looking for a function like mapWithFeedback
/mapAccum
, but for values in a Record<T, U>
.
from remeda.
can you give an example of what that'd look like? i'm not sure what you mean here; mapAccum
doesn't do that either
from remeda.
In Haskell I think there is a implementation for this, but not 100% sure.
const result = mapAccumObj({a: 1, b: 2, c: 4 }, (acc, n) => acc + inc(n), 0); // { a: 2, b: 5, c: 10 }
Similar to mapValues
, but for mapAccum
.
from remeda.
i'm not sure i see the use of this... entries in an object don't have an order they appear in. (technically, the order they're enumerated is consistent, but i don't think that records should be treated as having an order; in that case you want an array)
from remeda.
Related Issues (20)
- Allow `conditional.defaultCase` to infer its return type HOT 3
- Incorrect type assertion for isIncludedIn HOT 5
- Add optional `obj` parameter to `Evolver`? HOT 4
- Add `invariant` HOT 2
- Add `some` and `every`? HOT 16
- [Feature Request]: Support Maps in isDeepEqual HOT 6
- Add `sortedUniq` HOT 6
- Further improve `stringToPath` types; consolidate `setPath` and `pathOr`? HOT 5
- isDeepEqual and negation in guard can break type HOT 6
- Typing issue when using `isDeepEqual` in `differenceWith` function HOT 2
- Why is fromKeys typed with Partial<>? HOT 3
- `groupBy` has broken types HOT 3
- Test against Typescript nightlies HOT 2
- [Feature Request] Remeda ESLint Plugin HOT 7
- Add mergeAndConcat function HOT 1
- add mapEntries function HOT 6
- Add "R" or "Remeda" globally to the docs website for easy experiments HOT 4
- Unexpected types when using isNullish/isNonNullish in conditional HOT 1
- Incorrect type assertion in negative case for hasSubObject HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remeda.