Skip to content

Commit 149c2f1

Browse files
committed
update some examples
1 parent 836cbec commit 149c2f1

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929

3030
---
3131

32-
[*Example of usage*](https://tinyurl.com/2mknex43):
32+
[*Example of usage*](https://tinyurl.com/28zqjbun):
3333
```js
3434
import 'core-js/actual';
3535

36-
Promise.resolve(42).then(it => console.log(it)); // => 42
36+
Promise.try(() => 42).then(it => console.log(it)); // => 42
3737

3838
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
3939

4040
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
4141

42-
(function * (i) { while (true) yield i++; })(1)
42+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
4343
.drop(1).take(5)
4444
.filter(it => it % 2)
4545
.map(it => it ** 2)
@@ -57,13 +57,13 @@ import 'core-js/actual/array/from';
5757
import 'core-js/actual/array/flat-map';
5858
import 'core-js/actual/structured-clone';
5959

60-
Promise.resolve(42).then(it => console.log(it)); // => 42
60+
Promise.try(() => 42).then(it => console.log(it)); // => 42
6161

6262
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
6363

6464
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
6565

66-
(function * (i) { while (true) yield i++; })(1)
66+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
6767
.drop(1).take(5)
6868
.filter(it => it % 2)
6969
.map(it => it ** 2)
@@ -81,13 +81,13 @@ import from from 'core-js-pure/actual/array/from';
8181
import flatMap from 'core-js-pure/actual/array/flat-map';
8282
import structuredClone from 'core-js-pure/actual/structured-clone';
8383

84-
Promise.resolve(42).then(it => console.log(it)); // => 42
84+
Promise.try(() => 42).then(it => console.log(it)); // => 42
8585

8686
from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
8787

8888
flatMap([1, 2], it => [it, it]); // => [1, 1, 2, 2]
8989

90-
Iterator.from(function * (i) { while (true) yield i++; }(1))
90+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
9191
.drop(1).take(5)
9292
.filter(it => it % 2)
9393
.map(it => it ** 2)

packages/core-js-bundle/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525

2626
---
2727

28-
[*Example of usage*](https://tinyurl.com/2mknex43):
28+
[*Example of usage*](https://tinyurl.com/28zqjbun):
2929
```js
3030
import 'core-js/actual';
3131

32-
Promise.resolve(42).then(it => console.log(it)); // => 42
32+
Promise.try(() => 42).then(it => console.log(it)); // => 42
3333

3434
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
3535

3636
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
3737

38-
(function * (i) { while (true) yield i++; })(1)
38+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
3939
.drop(1).take(5)
4040
.filter(it => it % 2)
4141
.map(it => it ** 2)
@@ -53,13 +53,13 @@ import 'core-js/actual/array/from';
5353
import 'core-js/actual/array/flat-map';
5454
import 'core-js/actual/structured-clone';
5555

56-
Promise.resolve(42).then(it => console.log(it)); // => 42
56+
Promise.try(() => 42).then(it => console.log(it)); // => 42
5757

5858
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
5959

6060
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
6161

62-
(function * (i) { while (true) yield i++; })(1)
62+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
6363
.drop(1).take(5)
6464
.filter(it => it % 2)
6565
.map(it => it ** 2)
@@ -77,13 +77,13 @@ import from from 'core-js-pure/actual/array/from';
7777
import flatMap from 'core-js-pure/actual/array/flat-map';
7878
import structuredClone from 'core-js-pure/actual/structured-clone';
7979

80-
Promise.resolve(42).then(it => console.log(it)); // => 42
80+
Promise.try(() => 42).then(it => console.log(it)); // => 42
8181

8282
from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
8383

8484
flatMap([1, 2], it => [it, it]); // => [1, 1, 2, 2]
8585

86-
Iterator.from(function * (i) { while (true) yield i++; }(1))
86+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
8787
.drop(1).take(5)
8888
.filter(it => it % 2)
8989
.map(it => it ** 2)

packages/core-js-pure/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525

2626
---
2727

28-
[*Example of usage*](https://tinyurl.com/2mknex43):
28+
[*Example of usage*](https://tinyurl.com/28zqjbun):
2929
```js
3030
import 'core-js/actual';
3131

32-
Promise.resolve(42).then(it => console.log(it)); // => 42
32+
Promise.try(() => 42).then(it => console.log(it)); // => 42
3333

3434
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
3535

3636
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
3737

38-
(function * (i) { while (true) yield i++; })(1)
38+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
3939
.drop(1).take(5)
4040
.filter(it => it % 2)
4141
.map(it => it ** 2)
@@ -53,13 +53,13 @@ import 'core-js/actual/array/from';
5353
import 'core-js/actual/array/flat-map';
5454
import 'core-js/actual/structured-clone';
5555

56-
Promise.resolve(42).then(it => console.log(it)); // => 42
56+
Promise.try(() => 42).then(it => console.log(it)); // => 42
5757

5858
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
5959

6060
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
6161

62-
(function * (i) { while (true) yield i++; })(1)
62+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
6363
.drop(1).take(5)
6464
.filter(it => it % 2)
6565
.map(it => it ** 2)
@@ -77,13 +77,13 @@ import from from 'core-js-pure/actual/array/from';
7777
import flatMap from 'core-js-pure/actual/array/flat-map';
7878
import structuredClone from 'core-js-pure/actual/structured-clone';
7979

80-
Promise.resolve(42).then(it => console.log(it)); // => 42
80+
Promise.try(() => 42).then(it => console.log(it)); // => 42
8181

8282
from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
8383

8484
flatMap([1, 2], it => [it, it]); // => [1, 1, 2, 2]
8585

86-
Iterator.from(function * (i) { while (true) yield i++; }(1))
86+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
8787
.drop(1).take(5)
8888
.filter(it => it % 2)
8989
.map(it => it ** 2)

packages/core-js/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525

2626
---
2727

28-
[*Example of usage*](https://tinyurl.com/2mknex43):
28+
[*Example of usage*](https://tinyurl.com/28zqjbun):
2929
```js
3030
import 'core-js/actual';
3131

32-
Promise.resolve(42).then(it => console.log(it)); // => 42
32+
Promise.try(() => 42).then(it => console.log(it)); // => 42
3333

3434
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
3535

3636
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
3737

38-
(function * (i) { while (true) yield i++; })(1)
38+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
3939
.drop(1).take(5)
4040
.filter(it => it % 2)
4141
.map(it => it ** 2)
@@ -53,13 +53,13 @@ import 'core-js/actual/array/from';
5353
import 'core-js/actual/array/flat-map';
5454
import 'core-js/actual/structured-clone';
5555

56-
Promise.resolve(42).then(it => console.log(it)); // => 42
56+
Promise.try(() => 42).then(it => console.log(it)); // => 42
5757

5858
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
5959

6060
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
6161

62-
(function * (i) { while (true) yield i++; })(1)
62+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
6363
.drop(1).take(5)
6464
.filter(it => it % 2)
6565
.map(it => it ** 2)
@@ -77,13 +77,13 @@ import from from 'core-js-pure/actual/array/from';
7777
import flatMap from 'core-js-pure/actual/array/flat-map';
7878
import structuredClone from 'core-js-pure/actual/structured-clone';
7979

80-
Promise.resolve(42).then(it => console.log(it)); // => 42
80+
Promise.try(() => 42).then(it => console.log(it)); // => 42
8181

8282
from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
8383

8484
flatMap([1, 2], it => [it, it]); // => [1, 1, 2, 2]
8585

86-
Iterator.from(function * (i) { while (true) yield i++; }(1))
86+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
8787
.drop(1).take(5)
8888
.filter(it => it % 2)
8989
.map(it => it ** 2)

0 commit comments

Comments
 (0)