InfiniteScrollMixin Class
A mixin for infinite scrolls.
Item Index
Methods
Properties
Events
Methods
_updateInfiniteCount
-
addedLength
Increments a property after the infinite scroll is finished.
Parameters:
-
addedLength
Numberthe incremental length of the model
_updateScrollProperties
-
addedLength
Calls _updateInfiniteCount
and updateInfiniteAvailable
.
Parameters:
-
addedLength
Numberthe incremental length of the model
afterInfiniteQuery
-
newRecords
Record processing or anything else that needs to happen with the returned records.
Parameters:
-
newRecords
Objectthe records returned in this cycle
beforeInfiniteQuery
-
params
Called immediately before the infinite query starts.
Parameters:
-
params
Objectthe params that will be used in the query
infiniteQuery
-
modelName
-
params
The query that will be used.
Parameters:
-
modelName
Stringthe name of the model
-
params
Objectthe params that will be used in the query
Returns:
the records
performInfinite
-
modelName
-
params
Does what's needed for the infinite scroll.
- sets
infiniteQuerying
totrue
- if passed
modelName
, setsinfiniteModelName
- if passed
params
, setsinfiniteQueryParams
- calls
beforeInfiniteQuery
- calls
infiniteQuery
then: - calls
afterInfiniteQuery
- calls
_updateInfiniteProperties
- sets
infiniteQuerying
tofalse
Parameters:
-
modelName
Stringthe model to be queried
-
params
Objectparams to use in the query
Returns:
the records
updateHasMoreContent
-
addedLength
Determines whether the infinite scroll should continue after it finishes.
Parameters:
-
addedLength
Numberthe incremental length of the model
Properties
_cycleCount
Number
private
The number of queries that have cycled.
Default: 0
_fullQueryParams
Unknown
private
The default parameters.
Default: ['start', 'limit']
hasMoreContent
Boolean
True if there is more content on the server.
Default: true
infiniteContentPropertyName
String
The name of the property that the infiniteScroll
records will be added to.
Default: 'model'
infiniteIncrementBy
String
The property that will increment infiniteIncrementProperty
.
Default: 'limit'
infiniteIncrementProperty
String
The property that will be incremented after each cycle.
Default: 'start'
infiniteModelType
String
The model name that will be queried.
Default: ''
infiniteQuerying
Unknown
True if a request has been initiated but not resolved.
Default: false
infiniteQueryParams
Array
An array of params that are needed for the infinite query.
Default: []
infiniteScrollAvailable
Unknown
True if the query can be sent.
Default: true
limit
Number
The limit param.
Default: 12
start
Number
The start param.
Default: 0
Events
performInfinite
Debounces _performInfinite