Interface: ListModuleOptions<T>
lists/types/ListModuleOptions.ListModuleOptions
The construction parameters for lists dictate the behavior around handling its Singles and the network requests used to manage them.
Type parameters
Name |
---|
T |
Properties
currentPage
• Optional
currentPage: number
The current page of the request. This is always 1 in cases where the list endpoint isn't paginated.
Note that this value is fed to a transformation function and may change the value of params when set.
TODO: Implement and document the transformation functionality.
Defined in
src/base/lists/types/ListModuleOptions.ts:25
endpoint
• Optional
endpoint: string
The URL for the endpoint this list tracks. #
by default, which will make sure all the singles use
#
as well. See the Single module documentation for more details.
Defined in
src/base/lists/types/ListModuleOptions.ts:30
grow
• Optional
grow: boolean
Whether the list should be an 'infinite scrolling' list where the more the user scrolls the more items are added, rather than replacing the entire page with a new page.
Defined in
src/base/lists/types/ListModuleOptions.ts:17
keyProp
• Optional
keyProp: keyof T
The unique identifier key prop on the singles pulled from this endpoint. This will depend on your API but most of the time it will be 'id', which is the default value.
Defined in
src/base/lists/types/ListModuleOptions.ts:53
name
• Private
name: string
The name of the module. Don't specify this-- it will be automatically supplied internally elsewhere.
Defined in
src/base/lists/types/ListModuleOptions.ts:12
pageSize
• Optional
pageSize: number
The page size to request from the server. The default for this is in the global settings.
Note that this value is fed to a transformation function and may change the value of params when set.
TODO: Implement and document the transformation functionality.
Defined in
src/base/lists/types/ListModuleOptions.ts:38
paginated
• Optional
paginated: boolean
Whether or not this endpoint is paginated. Defaults to true. Paginated endpoints are put through transformation functions to handle the pagination.
TODO: Implement and document the transformation functionality.
Defined in
src/base/lists/types/ListModuleOptions.ts:60
params
• Optional
params: null
| QueryParams
The query string parameters used when performing network operations on the endpoint. *
Defined in
src/base/lists/types/ListModuleOptions.ts:62
persistent
• Optional
persistent: boolean
If set to True, the registry will not remove this module even if all listening components are removed.
Defined in
src/base/lists/types/ListModuleOptions.ts:48
reverse
• Optional
reverse: boolean
Flag that indicates if the contents of the list should be considered in inverted order. This is most useful when dealing with an endpoint that provides 'most recent' value as the last item. Most commonly used with 'growth', it can be used for situations like 'loading more comment history' and scrolling up to see the result.