Skip to content

Commit d213b3b

Browse files
committed
Record documentation
1 parent f56ed46 commit d213b3b

File tree

5 files changed

+355
-32
lines changed

5 files changed

+355
-32
lines changed

website/docs/List.mdx

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Create a new immutable List containing the values of the provided collection-lik
2121

2222
<Signature code={`List<T>(collection?: Iterable<T> | ArrayLike<T>): List<T>`} />
2323

24-
Note: <CodeLink to="List" /> is a factory function and not a class, and does not use the `new` keyword during construction.
24+
Note: <CodeLink to="../List" /> is a factory function and not a class, and does not use the `new` keyword during construction.
2525

2626
<Repl imports={['List', 'Set']} defaultValue={`List()`} />
2727

@@ -661,9 +661,7 @@ Returns a new List with the separator inserted between each value in this List.
661661

662662
<Signature code={`interpose(separator: T): List<T>`} />
663663

664-
<Repl
665-
defaultValue={`List([ 1, 2, 3 ]).interpose(0)`}
666-
/>
664+
<Repl defaultValue={`List([ 1, 2, 3 ]).interpose(0)`} />
667665

668666
<MemberLabel label="interleave()" />
669667

@@ -675,15 +673,11 @@ Returns a new List with the values from each collection interleaved.
675673

676674
The resulting Collection includes the first item from each, then the second from each, etc.
677675

678-
<Repl
679-
defaultValue={`List([ 1, 2, 3 ]).interleave(List([ 4, 5, 6 ]))`}
680-
/>
676+
<Repl defaultValue={`List([ 1, 2, 3 ]).interleave(List([ 4, 5, 6 ]))`} />
681677

682678
The shortest Collection stops interleave.
683679

684-
<Repl
685-
defaultValue={`List([ 1, 2, 3 ]).interleave(List([ 4, 5 ]))`}
686-
/>
680+
<Repl defaultValue={`List([ 1, 2, 3 ]).interleave(List([ 4, 5 ]))`} />
687681

688682
Since `interleave()` re-indexes values, it produces a complete copy, which has `O(N)` complexity.
689683

@@ -854,7 +848,7 @@ Returns the maximum value in this collection. If any values are comparatively eq
854848

855849
<Repl defaultValue={`List([ 1, 2, 3, 4 ]).max()`} />
856850

857-
The comparator is used in the same way as <CodeLink to="Collection#sort()">Collection#sort</CodeLink>. If it is not provided, the default comparator is `>`.
851+
The comparator is used in the same way as <CodeLink to="../Collection#sort()">Collection#sort</CodeLink>. If it is not provided, the default comparator is `>`.
858852

859853
When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative only when types do not differ.
860854

@@ -889,7 +883,7 @@ Returns the minimum value in this collection. If any values are comparatively eq
889883

890884
<Repl defaultValue={`List([ 1, 2, 3, 4 ]).min()`} />
891885

892-
The comparator is used in the same way as <CodeLink to="Collection#sort()">Collection#sort</CodeLink>. If it is not provided, the default comparator is `<`.
886+
The comparator is used in the same way as <CodeLink to="../Collection#sort()">Collection#sort</CodeLink>. If it is not provided, the default comparator is `<`.
893887

894888
When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative only when types do not differ.
895889

@@ -950,7 +944,9 @@ If two values have the same `hashCode`, they are [not guaranteed to be equal][Ha
950944

951945
Returns the value found by following a path of keys or indices through nested Collections.
952946

953-
<Signature code={`getIn(searchKeyPath: Iterable<unknown>, notSetValue?: unknown): unknown`} />
947+
<Signature
948+
code={`getIn(searchKeyPath: Iterable<unknown>, notSetValue?: unknown): unknown`}
949+
/>
954950

955951
<Repl
956952
defaultValue={`const { Map, List } = require('immutable')
@@ -1081,7 +1077,9 @@ Returns a new Seq.Indexed of [key, value] tuples.
10811077

10821078
The `sideEffect` is executed for every entry in the Collection.
10831079

1084-
<Signature code={`forEach(sideEffect: (value: V, key: K, iter: this) => unknown, context?: unknown): number`} />
1080+
<Signature
1081+
code={`forEach(sideEffect: (value: V, key: K, iter: this) => unknown, context?: unknown): number`}
1082+
/>
10851083

10861084
Unlike `Array#forEach`, if any call of `sideEffect` returns `false`, the iteration will stop. Returns the number of entries iterated (including the last iteration which returned false).
10871085

@@ -1127,7 +1125,9 @@ Returns a new Collection of the same type which excludes the last `amount` entri
11271125

11281126
Returns a new Collection of the same type which includes entries starting from when `predicate` first returns false.
11291127

1130-
<Signature code={`skipWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): List<T>`} />
1128+
<Signature
1129+
code={`skipWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): List<T>`}
1130+
/>
11311131

11321132
<Repl
11331133
defaultValue={`List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
@@ -1138,7 +1138,9 @@ Returns a new Collection of the same type which includes entries starting from w
11381138

11391139
Returns a new Collection of the same type which includes entries starting from when `predicate` first returns true.
11401140

1141-
<Signature code={`skipUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): this`} />
1141+
<Signature
1142+
code={`skipUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): this`}
1143+
/>
11421144

11431145
<Repl
11441146
defaultValue={`List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
@@ -1161,7 +1163,9 @@ Returns a new Collection of the same type which includes the last `amount` entri
11611163

11621164
Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns true.
11631165

1164-
<Signature code={`takeWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): List<T>`} />
1166+
<Signature
1167+
code={`takeWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): List<T>`}
1168+
/>
11651169

11661170
<Repl
11671171
defaultValue={`List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
@@ -1172,7 +1176,9 @@ Returns a new Collection of the same type which includes entries from this Colle
11721176

11731177
Returns a new Collection of the same type which includes entries from this Collection as long as the `predicate` returns false.
11741178

1175-
<Signature code={`takeUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): List<T>`} />
1179+
<Signature
1180+
code={`takeUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): List<T>`}
1181+
/>
11761182

11771183
<Repl
11781184
defaultValue={`List([ 'dog', 'frog', 'cat', 'hat', 'god' ])
@@ -1185,31 +1191,39 @@ Returns a new Collection of the same type which includes entries from this Colle
11851191

11861192
Reduces the Collection to a value by calling the `reducer` for every entry in the Collection and passing along the reduced value.
11871193

1188-
<Signature code={`reduce<R>(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R
1189-
reduce<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R`} />
1194+
<Signature
1195+
code={`reduce<R>(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R
1196+
reduce<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R`}
1197+
/>
11901198

11911199
If `initialReduction` is not provided, the first item in the Collection will be used.
11921200

11931201
<MemberLabel label="reduceRight()" />
11941202

11951203
Reduces the Collection in reverse (from the right side).
11961204

1197-
<Signature code={`reduceRight<R>(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R
1198-
reduceRight<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R`} />
1205+
<Signature
1206+
code={`reduceRight<R>(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: unknown): R
1207+
reduceRight<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R`}
1208+
/>
11991209

12001210
Note: Similar to this.reverse().reduce(), and provided for parity with `Array#reduceRight`.
12011211

12021212
<MemberLabel label="every()" />
12031213

12041214
True if `predicate` returns true for all entries in the Collection.
12051215

1206-
<Signature code={`every(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): boolean`} />
1216+
<Signature
1217+
code={`every(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): boolean`}
1218+
/>
12071219

12081220
<MemberLabel label="some()" />
12091221

12101222
True if `predicate` returns true for any entry in the Collection.
12111223

1212-
<Signature code={`some(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): boolean`} />
1224+
<Signature
1225+
code={`some(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): boolean`}
1226+
/>
12131227

12141228
<MemberLabel label="join()" />
12151229

@@ -1229,8 +1243,10 @@ For some lazy `Seq`, `isEmpty` might need to iterate to determine emptiness. At
12291243

12301244
Returns the size of this Collection.
12311245

1232-
<Signature code={`count(): number
1233-
count(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): number`} />
1246+
<Signature
1247+
code={`count(): number
1248+
count(predicate: (value: V, key: K, iter: this) => boolean, context?: unknown): number`}
1249+
/>
12341250

12351251
Regardless of if this Collection can describe its size lazily (some Seqs cannot), this method will always return the correct size. E.g. it evaluates a lazy `Seq` if necessary.
12361252

@@ -1240,7 +1256,9 @@ If `predicate` is provided, then this returns the count of entries in the Collec
12401256

12411257
Returns a `Seq.Keyed` of counts, grouped by the return value of the `grouper` function.
12421258

1243-
<Signature code={`countBy<G>(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map<G, number>`} />
1259+
<Signature
1260+
code={`countBy<G>(grouper: (value: V, key: K, iter: this) => G, context?: unknown): Map<G, number>`}
1261+
/>
12441262

12451263
Note: This is not a lazy operation.
12461264

website/docs/Map.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ Returns the maximum value in this collection. If any values are comparatively eq
12451245

12461246
<Repl defaultValue={`Map({ a: 1, b: 2, c: 3, d: 4 }).max()`} />
12471247

1248-
The comparator is used in the same way as <CodeLink to="Collection#sort()">Collection#sort</CodeLink>. If it is not provided, the default comparator is `>`.
1248+
The comparator is used in the same way as <CodeLink to="../Collection#sort()">Collection#sort</CodeLink>. If it is not provided, the default comparator is `>`.
12491249

12501250
When two values are considered equivalent, the first encountered will be returned. Otherwise, `max` will operate independent of the order of input as long as the comparator is commutative. The default comparator `>` is commutative only when types do not differ.
12511251

@@ -1280,7 +1280,7 @@ Returns the minimum value in this collection. If any values are comparatively eq
12801280

12811281
<Repl defaultValue={`Map({ a: 1, b: 2, c: 3, d: 4 }).min()`} />
12821282

1283-
The comparator is used in the same way as <CodeLink to="Collection#sort()">Collection#sort</CodeLink>. If it is not provided, the default comparator is `<`.
1283+
The comparator is used in the same way as <CodeLink to="../Collection#sort()">Collection#sort</CodeLink>. If it is not provided, the default comparator is `<`.
12841284

12851285
When two values are considered equivalent, the first encountered will be returned. Otherwise, `min` will operate independent of the order of input as long as the comparator is commutative. The default comparator `<` is commutative only when types do not differ.
12861286

0 commit comments

Comments
 (0)