Skip to content

Commit

Permalink
📚 docs: Add code sample and remove unnecessary runtime warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Apr 30, 2021
1 parent 2d653fe commit 6a657e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
Iterable sorting for JavaScript.
See [docs](https://iterable-iterator.github.io/sorted/index.html).

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

[![License](https://img.shields.io/github/license/iterable-iterator/sorted.svg)](https://raw.githubusercontent.com/iterable-iterator/sorted/main/LICENSE)
[![Version](https://img.shields.io/npm/v/@iterable-iterator/sorted.svg)](https://www.npmjs.org/package/@iterable-iterator/sorted)
Expand Down
17 changes: 3 additions & 14 deletions doc/manual/usage.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
# Usage

> :warning: Depending on your environment, the code may require
> `regeneratorRuntime` to be defined, for instance by importing
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
First, require the polyfill at the entry point of your application
```js
require( 'regenerator-runtime/runtime' ) ;
// or
import 'regenerator-runtime/runtime.js' ;
```

Then, import the library where needed
Import the library where needed
```js
const sorted = require( '@iterable-iterator/sorted' ) ;
const {sorted} = require( '@iterable-iterator/sorted' ) ;
// or
import * as sorted from '@iterable-iterator/sorted' ;
import {sorted} from '@iterable-iterator/sorted' ;
```

0 comments on commit 6a657e4

Please sign in to comment.