monocle-ts
Functional optics: a (partial) porting of Scala monocle (by gcanti)
reatom
Reatom - the ultimate state manager (by artalar)
Our great sponsors
monocle-ts | reatom | |
---|---|---|
7 | 2 | |
1,016 | 948 | |
- | - | |
0.0 | 9.7 | |
over 1 year ago | 1 day ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
monocle-ts
Posts with mentions or reviews of monocle-ts.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-12-21.
-
Deep Cloning Objects in JavaScript, the Modern Way
Instead of the "deep path properties" syntax, you might want to take the opportunity to learn about functional lenses with monocle-ts
-
I may have a crush on the TypeScript compiler, because of stuff like this
You may be interested also in checking out the implementation of Lens in monocle-ts, one of the libraries in the fp-ts ecosystem
-
Haskell Lens Tutorial by Exercises
For anyone - anyone who's faffed around with JavaScript's spread syntax when working with nested immutable data, anyway - struggling to understand the general concept or utility of lenses, I'd encourage looking into monocle-ts. The motivation [0] that kicks off the README instantly made me a believer, and TypeScript's idiosyncratic type system makes using the library remarkably natural; it fits right in without needing to deal with anything analogous to Template Haskell.
-
Is there a cleaner way to immutably update a deeply nested attribute? (I feel like this is not very clean)
You could have a look at the monocle-ts library. It was designed to deal with this kind of problem.
-
Simple Immutable Data w/ Spectacles π
spectacles-ts integrates seamlessly with the fp-ts ecosystem (it's built on top of the excellent monocle-ts library)
-
Why is it so difficult to modify a deeply nested state in React?
lenses help with this quite a bit, check out monocle-ts
-
You could have invented lenses!
You notice that Getters are composable as they are just pure functions, but the fact that setters are mutating values is not that nice. Tho, at this point we have invented quasi mutable lenses and If you really want you might invent actual purely functional lenses as well, but thatβs for another day. Meanwhile you can take a look at an actual typescript lesses library from @gcanti / monocle-ts.
reatom
Posts with mentions or reviews of reatom.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-05-10.
-
Is redux and thunks still used or are there other alternatives for it now?
Nanostores and Reatom are also great, fast atomic libs
-
Why is it so difficult to modify a deeply nested state in React?
Nice one, really! https://github.com/artalar/reatom
What are some alternatives?
When comparing monocle-ts and reatom you can also consider the following projects:
optics-ts - Type-safe, ergonomic, polymorphic optics for TypeScript
zustand - π» Bear necessities for state management in React
jotai - π» Primitive and flexible state management for React
spectacles-ts - Practical Optics β’ Unfancy monocle-ts
valtio - π Valtio makes proxy-state simple for React and Vanilla
immutability-helper - mutate a copy of data without changing the original source
zedux - :zap: A Molecular State Engine for React
fp-ts-contrib - A community driven utility package for fp-ts
nanostores - A tiny (286 bytes) state manager for React/RN/Preact/Vue/Svelte with many atomic tree-shakable stores
resso - πͺ’ The simplest React state manager