@darwino/darwino
Version:
A set of Javascript classes and utilities
42 lines (41 loc) • 796 B
JavaScript
/*
* (c) Copyright Darwino Inc. 2014-2017.
*/
export default class JSArrayDataFetcher {
_array = []
constructor(props) {
this._array = props.values
}
init() {
}
getArray() {
return this._array
}
setArray(array) {
this._array = array;
if(this.onDataLoaded) this.onDataLoaded(0,this.getRowCount())
}
isFetching() {
return false
}
isError() {
return false
}
getErrorMessage() {
return null
}
hasMoreRows() {
return false
}
getRow(i) {
return this._array[i]
}
getRows(skip,limit) {
return this._array.slice(skip, limit)
}
getRowCount() {
return this._array ? this._array.length : 0
}
loadMoreRows() {
}
}