import HomePresenter from 'PedalPatrol/src/components/presenters/home-presenter.js'
HomePresenter
Extends:
Class for the Home presenter and view
Constructor Summary
Public Constructor | ||
public |
constructor(view: Object) Creates an instance of HomePresenter |
Member Summary
Public Members | ||
public |
forceRefresh: * Forces a refresh for the view by recalcuating the timeago property, resorting bookmarked data and setting the state again. |
|
public |
getBookmarked(id: Number): Boolean: * Returns the bookmarked state for a bike ID |
|
public |
Gets the data from the model and returns it to the caller. |
|
public |
Get the number of notifications from the Alerts model. |
|
public |
getProfileImage(callback: Function): * Get the profile picture from the profile model |
|
public |
Handle the search cancel. |
|
public |
Handle the search clear |
|
public |
handleSearchFilter(text: string): * Filter the items in the list based on the text passed in. |
|
public |
onDestroy: * If the view or presenter is destroyed, unsubscribe the presenter from the model. |
|
public |
Called when the model is updated with new data. |
|
public |
setBookmark(id: Number): * Sets the bookmark for the notification ID |
|
public |
Updates the bike model with new data. |
|
public |
view: * |
Method Summary
Private Methods | ||
private |
testUpdateInjection(data: *) |
Public Constructors
Public Members
public forceRefresh: * source
Forces a refresh for the view by recalcuating the timeago property, resorting bookmarked data and setting the state again.
public getNotificationCount: Number: * source
Get the number of notifications from the Alerts model.
public handleSearchFilter(text: string): * source
Filter the items in the list based on the text passed in. Called every time a letter is typed.
public onDestroy: * source
If the view or presenter is destroyed, unsubscribe the presenter from the model.
public onUpdated(newData: Object): * source
Called when the model is updated with new data. Refreshes the state of the view. Method is supplied with the data to add. Better way to refresh the state?
public view: * source
Private Methods
private testUpdateInjection(data: *) source
Params:
Name | Type | Attribute | Description |
data | * |