File tree 3 files changed +11
-9
lines changed
3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 4
4
Skip list data structure for JavaScript.
5
5
See [ docs] ( https://data-structures-and-algorithms.github.io/skip-list/index.html ) .
6
6
7
- > :warning : The code requires ` regeneratorRuntime ` to be defined, for instance by importing
7
+ > :warning : Depending on your environment, the code may require
8
+ > ` regeneratorRuntime ` to be defined, for instance by importing
8
9
> [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
9
10
10
11
``` js
Original file line number Diff line number Diff line change 1
1
# Usage
2
2
3
- > :warning : The code requires ` regeneratorRuntime ` to be defined, for instance by importing
3
+ > :warning : Depending on your environment, the code may require
4
+ > ` regeneratorRuntime ` to be defined, for instance by importing
4
5
> [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
5
6
6
7
First, require the polyfill at the entry point of your application
7
8
``` js
8
- await import ( ' regenerator-runtime/runtime.js' );
9
+ await import (' regenerator-runtime/runtime.js' );
9
10
// or
10
- import ' regenerator-runtime/runtime.js' ;
11
+ import ' regenerator-runtime/runtime.js' ;
11
12
```
12
13
13
14
Then, import the library where needed
14
15
``` js
15
- const skiplist = await import ( ' @data-structure/skip-list' ) ;
16
+ const { SkipList } = await import (' @data-structure/skip-list' ) ;
16
17
// or
17
- import * as skiplist from ' @data-structure/skip-list' ;
18
+ import { SkipList } from ' @data-structure/skip-list' ;
18
19
```
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ const domReady = function (callback) {
7
7
}
8
8
} ;
9
9
10
- domReady ( function ( ) {
10
+ domReady ( ( ) => {
11
11
const projectname = document . createElement ( 'a' ) ;
12
12
projectname . classList . add ( 'project-name' ) ;
13
- projectname . text = 'data-structure/skip-list' ;
13
+ projectname . text = '@ data-structure/skip-list' ;
14
14
projectname . href = './index.html' ;
15
15
16
16
const header = document . querySelector ( 'header' ) ;
@@ -25,7 +25,7 @@ domReady(function () {
25
25
const input = document . querySelector ( '.search-input' ) ;
26
26
27
27
// Active search box when focus on searchBox.
28
- input . addEventListener ( 'focus' , function ( ) {
28
+ input . addEventListener ( 'focus' , ( ) => {
29
29
searchBox . classList . add ( 'active' ) ;
30
30
} ) ;
31
31
} ) ;
You can’t perform that action at this time.
0 commit comments