tutuca 0.9.55 → 0.9.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skill/immutable-js/SKILL.md +12 -13
package/package.json
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: immutable-js
|
|
3
|
-
description: Reference for the Immutable.js API organized by datatype (List, Map, Set, OrderedMap, OrderedSet, Stack, Record, Seq, Collection, Range, Repeat) and by topic (deep updates, equality, type predicates, JS conversion). Use when the user asks how to use a specific Immutable.js datatype or method, when writing or reviewing code
|
|
3
|
+
description: Reference for the Immutable.js API organized by datatype (List, Map, Set, OrderedMap, OrderedSet, Stack, Record, Seq, Collection, Range, Repeat) and by topic (deep updates, equality, type predicates, JS conversion). Use when the user asks how to use a specific Immutable.js datatype or method, when writing or reviewing code that imports from `immutable`, or when explaining Immutable.js semantics like persistent updates, value equality, or lazy evaluation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Immutable.js
|
|
7
7
|
|
|
8
|
-
Persistent immutable data structures
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`is(a, b)` or `a.equals(b)`, never `===`.
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import { Map } from 'immutable';
|
|
15
|
-
const m1 = Map({ a: 1, b: 2 });
|
|
16
|
-
const m2 = m1.set('b', 50);
|
|
17
|
-
m1.get('b'); // 2 — m1 is unchanged
|
|
18
|
-
m2.get('b'); // 50
|
|
19
|
-
```
|
|
8
|
+
Persistent immutable data structures: every operation returns a new collection,
|
|
9
|
+
never mutates. Treat collections as **values** — compare with `is(a, b)` or
|
|
10
|
+
`a.equals(b)`, never `===`. See [equality.md](references/equality.md).
|
|
20
11
|
|
|
21
12
|
## Inheritance cheatsheet
|
|
22
13
|
|
|
@@ -36,6 +27,14 @@ Seq mirrors the hierarchy lazily:
|
|
|
36
27
|
└─ Seq.Set ─ set-like lazy sequence
|
|
37
28
|
```
|
|
38
29
|
|
|
30
|
+
## How to use this skill
|
|
31
|
+
|
|
32
|
+
Load only the reference file(s) that match the question — do not preload
|
|
33
|
+
all of them. Pick a datatype file when the question is about one type's
|
|
34
|
+
methods; pick an operations/topics file when the question crosses types
|
|
35
|
+
(deep updates, equality, conversions). For exact signatures, fall back
|
|
36
|
+
to `type-definitions/immutable.d.ts` (see *Authoritative sources* below).
|
|
37
|
+
|
|
39
38
|
## Datatypes
|
|
40
39
|
|
|
41
40
|
Read the reference for a specific datatype when answering questions about
|