import { html } from 'lit-html'; import { customElement, property } from '@lit-html-free/core'; import './article-preview'; @customElement('article-list') export default class extends HTMLElement { @property() public articles: any[] = []; @property() public totalPages: any = []; @property() public currentPage: number; @property() public totalPsetPageCbages: Function; public setPageCb: Function; valuesChanged(_type: string, attribute: string, oldV: number, newV: number) { if (attribute === 'currentPage' && oldV && oldV !== newV) { this.setPageCb(newV); } } public render() { return html` ${this.articles.length === 0 ? html`
No articles are here... yet.
` : ''} ${this.articles.map(article => { return html` `; })} ${this.totalPages && this.totalPages.length ? html` ` : ''} `; } }