Skip to content

Commit

Permalink
v0.0.4-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dhilt committed Apr 28, 2018
1 parent 6a63469 commit 88aaec1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The \*uiScroll directive dynamically destroys elements as they become invisible
- infinite mode (items rendered once are never removed), [demo](https://dhilt.github.io/ngx-ui-scroll/#infinite-mode)
- horizontal mode, [demo](https://dhilt.github.io/ngx-ui-scroll/#horizontal-mode)
- different item heights, [demo](https://dhilt.github.io/ngx-ui-scroll/#different-item-heights)
- special Adapter API object to manipulate and assess the scroller, [demos](https://dhilt.github.io/ngx-ui-scroll/adapter)
- AoT compilation

### Getting
Expand Down Expand Up @@ -77,14 +78,14 @@ where the viewport is a scrollable area of finite height.
}
```

\*uiScroll acts like \*ngFor, but the datasource is an object of special type Datasource that can be imported to the host component from UiScrollModule. It implements method _get_ to be used by the \*uiScroll directive to access the data by _index_ and _count_ parameters.
\*uiScroll acts like \*ngFor, but the datasource is an object of special type (IDatasource) that can be imported to the host component from UiScrollModule. It implements method _get_ to be used by the \*uiScroll directive to access the data by _index_ and _count_ parameters.

```javascript
import { Datasource } from 'ngx-ui-scroll';
import { IDatasource } from 'ngx-ui-scroll';

export class AppComponent {

public datasource: Datasource = {
public datasource: IDatasource = {
get: (index, count, success) => {
const data = [];
for (let i = index; i <= index + count - 1; i++) {
Expand All @@ -99,13 +100,13 @@ export class AppComponent {
_Datasource.get_ must provide an array of _count_ data-items started from _index_ position. _Datasource.get_ has 3 signatures: callback based, Promise based and Observable based. So, if you want some remote API to be a source of your data, basically it may look like

```javascript
public datasource: Datasource = {
public datasource: IDatasource = {
get: (index, count) =>
this.http.get(`${myApiUrl}?index=${index}&count=${count}`)
};
```

More details could be found at the API section (in progress) and on the [DEMO page](https://dhilt.github.io/ngx-ui-scroll/).
More details could be found on the [DEMO page](https://dhilt.github.io/ngx-ui-scroll/).

### Developing

Expand Down
2 changes: 1 addition & 1 deletion package-dist.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-ui-scroll",
"version": "0.0.4-rc",
"version": "0.0.4-rc.1",
"description": "Infinite/virtual scroll for Angular",
"main": "./bundles/ngx-ui-scroll.umd.js",
"module": "./esm5/ngx-ui-scroll.js",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "ng serve --delete-output-path=false",
"build": "node build.js",
"test": "karma start",
"install-package": "npm run build && npm pack ./dist && npm install ngx-ui-scroll-0.0.4-rc.tgz --no-save",
"install-package": "npm run build && npm pack ./dist && npm install ngx-ui-scroll-0.0.4-rc.1.tgz --no-save",
"start-package": "npm run install-package && npm start"
},
"private": true,
Expand Down

0 comments on commit 88aaec1

Please sign in to comment.