object-path
immutable-js
Our great sponsors
object-path | immutable-js | |
---|---|---|
0 | 24 | |
987 | 31,980 | |
- | 0.3% | |
3.2 | 7.0 | |
about 2 months ago | 12 days ago | |
JavaScript | TypeScript | |
MIT License | MIT License |
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.
object-path
We haven't tracked posts mentioning object-path yet.
Tracking mentions began in Dec 2020.
immutable-js
-
Functional Programming Performance & Algorithms
Here's an example library in JS https://immutable-js.com/ another example is the Clojure programming language, their entire built-in data structures are all persistent https://clojure.org/reference/data_structures
-
What are some small library ideas for Node.js?
This is much more generally useful. Clojure has this behavior, as does ImmutableJS, and it makes objects and collections first-class and composable. There is a performance penalty, but if it’s fast enough for Java it’s fast enough for me.
-
Synchronized immutable state with time travel
We have got far, starting with initial attempts using abstractions like immutable which has a severe downside with interoperability. Then we went over to manually cloning objects and arrays using built-in language features like the spread operator, which makes it super unreadable to change complex structures. For example, nested objects or arrays with objects because you have to go inside whatever you want to change and then clone every object on your path to keep the object immutable.
-
Hooks Considered Harmful
Using ImmutableJS [1] for all the state variables avoids the identity issues he raises.
-
Learn React the hard way
React reshapes modern web frontend with its declarative UI paradigm (rethinking best practice), and it embraces FP at heart. Stateless components, side effect segregation etc all good stuff. Then you encounter immutability, and got amazed by the power of it - time travel debugging. Followed by an unstoppable learning path of immutable.js, immer.js etc. At the end of day, we all realized that JavaScript is a multi-paradigm language.
-
Introduction to Functional Programming in JavaScript
There are also libraries such as Immer and Immutable that were created to make our lives easier while dealing with immutability in JavaScript.
-
How to use var, let and const in block & function Scopes
Incase you intend to freeze nested objects i would recommend the use of the [immutable](https://immutable-js.com/#introduction) js library.
-
Lessons Learned from AOC 2021
I have been a huge proponent of functional programming in JavaScript. As seen throughout this series, the Haskell solutions can almost always be translated into decent looking JavaScript code. But as some have pointed out, the lack of certain features such as persistent data structures or tail call optimization makes it impossible to implement many real world applications. Using something like ImmutableJS would probably help, but replacing every single data structure with something from a library is objectionable.
-
How to handle "mutable state" in a pure functional way
Use persistent immutable data structures (as implemented in, for instance, mori or Immutable.js) to represent the state. As much as possible, push calculations into referentially transparent functions (i.e., input depends purely on output) which take persistent data. Write the interactions with the real world in imperative style.
-
Understanding Clojure's Persistent Vectors (2013)
Persistent data structures are, in my opinion, underrated. Not so much for every day programming tasks, but specifically for code that resembles planning/searching.
Here is one library I've heard of https://immutable-js.com/ . I don't know of others.
What are some alternatives?
mori - ClojureScript's persistent data structures and supporting API from the comfort of vanilla JavaScript
Immer - Create the next immutable state by mutating the current one
lodash - A modern JavaScript utility library delivering modularity, performance, & extras.
ramda - :ram: Practical functional Javascript
RxJS
immutability-helper - mutate a copy of data without changing the original source
fp-ts - Functional programming in TypeScript
Rambda - Faster and smaller alternative to Ramda
buckets - A complete, fully tested and documented data structure library written in pure JavaScript.
property-path - Get and set object properties using a string path, where you can specify the separator character in the path.
hashmap - HashMap JavaScript class for Node.js and the browser. The keys can be anything and won't be stringified
JSON-Schema Faker - JSON-Schema + fake data generators