Is there a cleaner way to immutably update a deeply nested attribute? (I feel like this is not very clean)

This page summarizes the projects mentioned and recommended in the original post on /r/typescript

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • Klotho - AWS Cloud-aware infrastructure-from-code toolbox [NEW]
  • InfluxDB - Access the most powerful time series database as a service
  • Sonar - Write Clean JavaScript Code. Always.
  • Immer

    Create the next immutable state by mutating the current one

  • monocle-ts

    Functional optics: a (partial) porting of Scala monocle

    You could have a look at the monocle-ts library. It was designed to deal with this kind of problem.

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • shades

    A lodash-inspired lens-like library for Javascript (by jamesmcnamara)

    There’s also https://github.com/jamesmcnamara/shades. It’s less of a direct Haskell port than some of the other lens libraries, and I found the interface pretty intuitive

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts