// Gets called by the router when an event for this model has been processed by observers, // great place for aggregate operations and/or validation. postProcess() { this._allStories = this._epics.flatMap(epic => epic.stories).toList(); if (this._selectedEpic) { this._displayedStories = this._allStories .filter(story => story.epic === this.selectedEpic) .toList(); } else { this._displayedStories = this.allStories; } this._showAllStoriesButton = this.selectedEpic && this.allStories.count() !== this.displayedStories.count(); this._epics.forEach(epic => { epic.postProcess(); }); }