InfiniteScrollContainerComponent Class
A component that contains infinite scrolled content.
Item Index
Methods
Properties
Events
Methods
_updateInfiniteCount
(
private
-
addedLength
Increments a property after the infinite scroll is finished.
Parameters:
-
addedLength
Numberthe incremental length of the model
_updateScrollProperties
(
private
-
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
didInsertElement
()
Gives the component access to the store and starts the infinite query.
infiniteQuery
(
Promise
-
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:
Promise:
the records
performInfinite
(
Promise
-
modelName
-
params
Does what's needed for the infinite scroll.
- sets
infiniteQuerying
to true
- if passed modelName
, sets infiniteModelName
- if passed params
, sets infiniteQueryParams
- calls beforeInfiniteQuery
- calls infiniteQuery
then:
- calls afterInfiniteQuery
- calls _updateInfiniteProperties
- sets infiniteQuerying
to false
Parameters:
-
modelName
Stringthe model to be queried -
params
Objectparams to use in the query
Returns:
Promise:
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
scrollContainer
String
Will be passed into the scroll listener to be the observed element on scroll.
Default: '.infinite-scroll-container'
start
Number
The start param.
Default: 0
Events
performInfinite
Debounces
_performInfinite