Class LazyArray
Defined in: LazyArray.js.
Constructor Attributes | Constructor Name and Description |
---|---|
LazyArray(lazyArrayParams, baseUrl)
Construct a new LazyArray, which partially loads large JSON arrays.
|
Method Attributes | Method Name and Description |
---|---|
index(i, callback, param)
call the callback on one element of the array
|
|
range(start, end, callback, postFun, param)
call the callback on each element in the range [start, end]
|
Class Detail
LazyArray(lazyArrayParams, baseUrl)
Construct a new LazyArray, which partially loads large JSON arrays.
- Parameters:
- lazyArrayParams
- {Object} as:
urlTemplate
- for each lazily-loaded array chunk, the chunk number will get substituted for {chunk} in this template, and the result will beused as the URL of the JSON for that array chunklength
- length of the overall arraychunkSize
- the size of each array chunk
- baseUrl
Method Detail
index(i, callback, param)
call the callback on one element of the array
- Parameters:
- i
- index
- callback
- callback, gets called with (i, value, param)
- param
- (optional) callback will get this as its last parameter
range(start, end, callback, postFun, param)
call the callback on each element in the range [start, end]
- Parameters:
- start
- index of first element to call the callback on
- end
- index of last element to call the callback on
- callback
- callback, gets called with (i, value, param)
- postFun
- (optional) callback that gets called when
callback
has been run on every element in the range - param
- (optional) callback will get this as its last parameter