DiscussionListState
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
app: * |
|
public |
discussions: *[] |
|
public |
|
|
public |
|
|
public |
params: * |
Method Summary
Public Methods | ||
public |
addDiscussion(discussion: *) Add a discussion to the top of the list. |
|
public |
clear() Clear cached discussions. |
|
public |
empty(): * Have the search results come up empty? |
|
public |
getParams(): * Get the search parameters. |
|
public |
hasDiscussions(): * Are there discussions stored in the discussion list state? |
|
public |
isLoading(): * Are discussions currently being loaded? |
|
public |
isSearchResults(): * In the last request, has the user searched for a discussion? |
|
public |
loadMore() Load the next page of discussion results. |
|
public |
loadResults(offset: *): * Load a new page of discussion results. |
|
public |
parseResults(results: *): * Parse results and append them to the discussion list. |
|
public |
refresh(objectPattern: {"deferClear": *}): * Clear and reload the discussion list. |
|
public |
refreshParams(newParams: *) If there are no cached discussions or the new params differ from the old ones, update params and refresh the discussion list from the database. |
|
public |
removeDiscussion(discussion: *) Remove a discussion from the list if it is present. |
|
public |
requestParams(): * Get the parameters that should be passed in the API request to get discussion results. |
|
public |
sortMap(): * Get a map of sort keys (which appear in the URL, and are used for translation) to the API sort value that they represent. |
Public Constructors
public constructor() source
Public Methods
public addDiscussion(discussion: *) source
Add a discussion to the top of the list.
Params:
Name | Type | Attribute | Description |
discussion | * |
public hasDiscussions(): * source
Are there discussions stored in the discussion list state?
Return:
* |
public isSearchResults(): * source
In the last request, has the user searched for a discussion?
Return:
* |
public loadResults(offset: *): * source
Load a new page of discussion results.
Params:
Name | Type | Attribute | Description |
offset | * | The index to start the page at. |
Return:
* |
public parseResults(results: *): * source
Parse results and append them to the discussion list.
Params:
Name | Type | Attribute | Description |
results | * |
Return:
* |
public refresh(objectPattern: {"deferClear": *}): * source
Clear and reload the discussion list. Passing the option deferClear: true
will clear discussions only after new data has been received.
This can be used to refresh discussions without loading animations.
Params:
Name | Type | Attribute | Description |
objectPattern | {"deferClear": *} |
|
Return:
* |
public refreshParams(newParams: *) source
If there are no cached discussions or the new params differ from the old ones, update params and refresh the discussion list from the database.
Params:
Name | Type | Attribute | Description |
newParams | * |
public removeDiscussion(discussion: *) source
Remove a discussion from the list if it is present.
Params:
Name | Type | Attribute | Description |
discussion | * |
public requestParams(): * source
Get the parameters that should be passed in the API request to get discussion results.
Return:
* |
public sortMap(): * source
Get a map of sort keys (which appear in the URL, and are used for translation) to the API sort value that they represent.
Return:
* |