Skip to content

Commit e848293

Browse files
committed
new 'get' signature for the datasource documented
1 parent ebd1cbd commit e848293

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,18 @@ The datasource object implements methods and properties to be used by the direct
9292

9393
* Method `get`
9494

95+
get(descriptor, success)
96+
or
97+
9598
get(index, count, success)
9699

97100
#### Description
98101
this is a mandatory method used by the directive to retrieve the data.
99102
#### Parameters
103+
* **descriptor** is an object defining the portion of the dataset requested. The object will have 3 properties. Two of them named `index` and `count`. They have the same meaning as in the alternative signature when the parameters passed explicitly (see below). The third one will be named either `append` if the items will be appended to the last item in the buffer, or `prepend` if they are to be prepended to the first item in the buffer. The value of the property in either case will be the item the new items will be appended/prepended to. This is useful if it is easier to identify the items to be added based on the previously requested items rather than on the index. Keep in mind that in certain use cases (i.e. on initial load) the value of the append/prepend property can be undefined.
100104
* **index** indicates the first data row requested
101105
* **count** indicates number of data rows requested
102-
* **success** function to call when the data are retrieved. The implementation of the service has to call this function when the data
103-
are retrieved and pass it an array of the items retrieved. If no items are retrieved, an empty array has to be passed.
106+
* **success** function to call when the data are retrieved. The implementation of the datsource has to call this function when the data are retrieved and pass it an array of the items retrieved. If no items are retrieved, an empty array has to be passed.
104107

105108
**Important:** Make sure to respect the `index` and `count` parameters of the request. The array passed to the success method should have
106109
exactly `count` elements unless it hit eof/bof

0 commit comments

Comments
 (0)