mori
proposal-record-tuple
Our great sponsors
mori | proposal-record-tuple | |
---|---|---|
5 | 73 | |
3,388 | 2,411 | |
- | 0.8% | |
0.0 | 2.7 | |
almost 4 years ago | 4 months ago | |
Clojure | HTML | |
- | - |
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.
mori
-
Om but in javascript
immutable-js or mori for immutable data structures
-
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)
-
Immutable.js is not dead!
Mori
proposal-record-tuple
-
Union, intersection, difference, and more are coming to JavaScript Sets
relevant issue, which is at the crux of this problem: https://github.com/tc39/proposal-record-tuple/issues/387
-
The Everything NPM Package
There are still so many basic things that aren't in the JS stdlib, though. A good example is Map - if you need to use a tuple of two values as a key, you're SOL because there's no way to customize key comparisons. Hopefully we'll get https://tc39.es/proposal-record-tuple/ eventually, but meanwhile languages ranging from C++ to Java to Python have had some sensible way to do this for over 20 years now.
-
Deep Cloning Objects in JavaScript, the Modern Way
If you’re reaching for structuredClone, what you really want is native immutable Record and Tuple syntax, and the companion “deep path properties” syntax which allows for efficient and ergonomic immutable updates:
-
Cool language features that Rust is missing?
It will be called "record" in JavaScript which will swing the popularity back the other way I guess (currently a language proposal)
-
Why doesn't TypeScript properly type Object.keys?
I suspect considering the strong desire to maintain consistency with JavaScript, we will eventually see something that when the Record proposal passes through tc39
-
ES2023 features list!
I hope the Record and Tuple proposal makes it through
-
[AskJS] Is JavaScript missing some built-in methods?
Record and tuple is at stage 2
-
[AskJS] Which utility libraries are in your opinion so good they are basicaly mandatory?
Can't wait until we get records and tuples and you won't have to resort to shenanigans like this just to check if data is equal to other data
-
Pipe Operator (|>) For JavaScript
I hope Records & Tuples[0] land before this does. It would have meaningful and far reaching positive effects for the language, without much controversy. Like most of these things, it takes about 5-7 years for it to permeate through enough of the engines to be meaningfully useful in the day to day of web developers (node / deno typically 12-18 months tops). It would drastically speed up existing code once wide adoption is gained though.
I don't think the Pipe Operator would be as useful in comparison
-
Which Language in your opinion is well designed?
You might be interested in the Stage 2 Tuples and Records proposal. It's one of the proposals I'm most excited about, but there will be interesting discussions on how TypeScript will integrate those into their type system.
What are some alternatives?
immutable-js - Immutable persistent data collections for Javascript which increase efficiency and simplicity.
Immer - Create the next immutable state by mutating the current one
ramda - :ram: Practical functional Javascript
lodash - A modern JavaScript utility library delivering modularity, performance, & extras.
underscore-contrib - The brass buckles on Underscore's utility belt
zod - TypeScript-first schema validation with static type inference
buckets - A complete, fully tested and documented data structure library written in pure JavaScript.
Index - ⚡ Pattern Matching in Typescript
lazy.js - Like Underscore, but lazier
hjson-js - Hjson for JavaScript
react-websocket - Easy-to-use React component for websocket communications.
hashmap - HashMap JavaScript class for Node.js and the browser. The keys can be anything and won't be stringified