Skip to content

Commit 6a657e4

Browse files
📚 docs: Add code sample and remove unnecessary runtime warning.
1 parent 2d653fe commit 6a657e4

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
Iterable sorting for JavaScript.
55
See [docs](https://iterable-iterator.github.io/sorted/index.html).
66

7-
> :building_construction: Caveat emptor! This is work in progress. Code may be
8-
> working. Documentation may be present. Coherence may be. Maybe.
9-
10-
> :warning: Depending on your environment, the code may require
11-
> `regeneratorRuntime` to be defined, for instance by importing
12-
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
7+
```js
8+
import {decreasing} from '@total-order/primitive';
9+
import {range} from '@iterable-iterator/range';
10+
import {sorted} from '@iterable-iterator/sorted';
11+
sorted(decreasing, range(13)); 12 11 10 9 8 ...
12+
```
1313

1414
[![License](https://img.shields.io/github/license/iterable-iterator/sorted.svg)](https://raw.githubusercontent.com/iterable-iterator/sorted/main/LICENSE)
1515
[![Version](https://img.shields.io/npm/v/@iterable-iterator/sorted.svg)](https://www.npmjs.org/package/@iterable-iterator/sorted)

doc/manual/usage.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
# Usage
22

3-
> :warning: Depending on your environment, the code may require
4-
> `regeneratorRuntime` to be defined, for instance by importing
5-
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
6-
7-
First, require the polyfill at the entry point of your application
8-
```js
9-
require( 'regenerator-runtime/runtime' ) ;
10-
// or
11-
import 'regenerator-runtime/runtime.js' ;
12-
```
13-
14-
Then, import the library where needed
3+
Import the library where needed
154
```js
16-
const sorted = require( '@iterable-iterator/sorted' ) ;
5+
const {sorted} = require( '@iterable-iterator/sorted' ) ;
176
// or
18-
import * as sorted from '@iterable-iterator/sorted' ;
7+
import {sorted} from '@iterable-iterator/sorted' ;
198
```

0 commit comments

Comments
 (0)