clear() { this.articlesRegistry.clear(); this.page = 0; }
@action loadArticles() { this.isLoading = true; return this.$req() .then(action(({ articles, articlesCount }) => { this.articlesRegistry.clear(); articles.forEach(article => this.articlesRegistry.set(article.slug, article)); this.totalPagesCount = Math.ceil(articlesCount / LIMIT); })) .finally(action(() => { this.isLoading = false; })); }
clear() { this.articlesRegistry.clear(); this.page = 0; }