2
2
3
3
[](https://www.npmjs.com/package/svelte-infinite-scroll) • [](https://github.com/andrelmlins/svelte-infinite-scroll/blob/master/LICENSE) • [](https://travis-ci.com/andrelmlins/svelte-infinite-scroll) • [](https://app.netlify.com/sites/svelte-infinite-scroll/deploys) • [](https://lgtm.com/projects/g/andrelmlins/svelte-infinite-scroll/context:javascript) • [](https://gitter.im/svelte-infinite-scroll/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
4
4
5
- Infinite Scroll Component to Svelte
5
+ Infinite Scroll Component to Svelte.
6
6
7
7
## Installation
8
8
9
- ```
9
+ ``` bash
10
10
npm i svelte-infinite-scroll
11
- // OR
11
+
12
+ // or
13
+
12
14
yarn add svelte-infinite-scroll
13
15
```
14
16
15
- < em >Note : to use this library in sapper , install as devDependency. See the [ link] ( https://github.com/sveltejs/sapper-template#using-external-components ) .</ em >
17
+ _ Note : to use this library in Sapper applications , install as devDependency. Take a look at [ this link] ( https://github.com/sveltejs/sapper-template#using-external-components ) ._
16
18
17
- ## Demo [ Link ] ( https://svelte-infinite-scroll.netlify.com/ )
19
+ ## Demo [ link ] ( https://svelte-infinite-scroll.netlify.com/ )
18
20
19
21
Local demo:
20
22
21
- ```
23
+ ``` bash
22
24
git clone https://github.com/andrelmlins/svelte-infinite-scroll.git
23
25
cd svelte-infinite-scroll
24
26
npm install && npm run dev
25
27
```
26
28
27
29
## Examples
28
30
29
- An example of how to use the library
31
+ An example of how to use the library:
30
32
31
33
``` js
32
34
< script>
33
- import SvelteInfiniteScroll from " svelte-infinite-scroll" ;
35
+ import InfiniteScroll from " svelte-infinite-scroll" ;
34
36
import allCountries from " ./countries.js" ;
35
37
36
38
let page = 0 ;
@@ -55,11 +57,11 @@ An example of how to use the library
55
57
{#each countries as country}
56
58
< li> {country .name }< / li>
57
59
{/ each}
58
- < SvelteInfiniteScroll threshold= {100 } on: loadMore= {() => page++ } / >
60
+ < InfiniteScroll threshold= {100 } on: loadMore= {() => page++ } / >
59
61
< / ul>
60
62
```
61
63
62
- ### Another Examples
64
+ ### Another examples
63
65
64
66
- Infinite scroll with requests | [ Link] ( https://svelte.dev/repl/4863a658f3584b81bbe3d9f54eb67899 ) | [ Author] ( https://github.com/kilianso )
65
67
- Infinite scroll reverse | [ Link] ( https://svelte.dev/repl/36d00aa55c7c4ff68914ce314f4e1ca4 ) | [ Author] ( https://github.com/andrelmlins )
@@ -83,9 +85,9 @@ Component props:
83
85
| ---------- | ----------------------------------------- |
84
86
| ` loadMore ` | Tells you if there are more items to load |
85
87
86
- ## NPM Statistics
88
+ ## NPM statistics
87
89
88
- Download stats for this NPM package
90
+ Download stats for this NPM package.
89
91
90
92
[ ![ NPM] ( https://nodei.co/npm/svelte-infinite-scroll.png )] ( https://nodei.co/npm/svelte-infinite-scroll/ )
91
93
0 commit comments