2019-09-07 21:54:44 +02:00
|
|
|
import { ViewController } from '../controller';
|
|
|
|
|
|
|
|
export class HomeController extends ViewController {
|
2019-09-16 20:32:53 +02:00
|
|
|
constructor(state, i18n) {
|
2019-09-07 21:54:44 +02:00
|
|
|
// Super passes state, view name, and default state to ViewController,
|
|
|
|
// which stores state in this.appState and the view controller's state to this.state
|
2019-09-16 20:32:53 +02:00
|
|
|
super(state, i18n, 'home', {
|
2019-09-14 06:43:07 +02:00
|
|
|
recentReviews: [],
|
|
|
|
recentUpdates: [],
|
2019-09-07 21:54:44 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
// If using controller methods in an input's onchange or onclick instance,
|
|
|
|
// either bind the class's 'this' instance to the method first...
|
|
|
|
// or use `onclick=${() => controller.submit()}` to maintain the 'this' of the class instead.
|
|
|
|
}
|
|
|
|
|
2019-09-14 06:43:07 +02:00
|
|
|
get recentReviews() {
|
|
|
|
return [...this.state.recentReviews];
|
|
|
|
}
|
|
|
|
get recentUpdates() {
|
|
|
|
return [...this.state.recentUpdates];
|
2019-09-07 21:54:44 +02:00
|
|
|
}
|
|
|
|
}
|