()
| 23 | } |
| 24 | |
| 25 | render() { |
| 26 | const { isPending, isError, isFetching, data, error } = this.post() |
| 27 | |
| 28 | return html` |
| 29 | <div> |
| 30 | <div> |
| 31 | <a href="#posts" @click=${this.back}>Back</a> |
| 32 | </div> |
| 33 | ${ |
| 34 | isPending |
| 35 | ? html`<div>Loading...</div>` |
| 36 | : isError |
| 37 | ? html`<span>Error: ${error.message}</span>` |
| 38 | : html` |
| 39 | <h1>${data.title}</h1> |
| 40 | <div> |
| 41 | <p>${data.body}</p> |
| 42 | </div> |
| 43 | <div>${isFetching ? 'Background Updating...' : ' '}</div> |
| 44 | ` |
| 45 | } |
| 46 | </div> |
| 47 | ` |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | customElements.define('post-detail', PostDetail) |
nothing calls this directly
no outgoing calls
no test coverage detected