Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Kotlin’s really nice, and even better with http://arrow-kt.io
I don't have anything particular in mind, but from what I remember, as I already said, almost every reduce that reconstructs objects. The most simple is something like this, but it's bloodier in practice: const newObj = kvps.reduce(obj, [k, v] => f(v) ? ({ ...obj, [k]: v }) : obj) vs const newObj = { ...obj }; for (const [k, v] of kvps) { if (f(v)) { newObj[k] = v; } } Also check this award winning javascript library that is basically a mutable syntax sugar to work with immutable data. It turned out so much useful that it's already built-in in redux-toolkit, which is a recommended way to use redux (a state management library often used with react).
Related posts
- Is there a cleaner way to immutably update a deeply nested attribute? (I feel like this is not very clean)
- Why do we need modules at all?
- How We Fixed Performance With JS Object Variable Mutation
- Why my variable is being mutated if I make any changes to my data ?
- How to synchronize access to application data in multithreaded asio?