Open History to see the last commit
1import { LitElement, html } from 'lit'
2import { QueryClient, QueryClientProvider } from '@tanstack/lit-query'
3import './styles.css'
4import './search-box'
5β
6const queryClient = new QueryClient()
7β
8class AlgoliaQueryProvider extends QueryClientProvider {
9 constructor() {
10 super()
11 this.client = queryClient
12 }
13}
14β
15class AlgoliaApp extends LitElement {
16 protected override createRenderRoot(): HTMLElement | DocumentFragment {
17 return this
18 }
19β
20 render() {
21 return html`
22 <algolia-query-provider>
23 <div class="App">
24 <h1>TanStack Query with Algolia</h1>
25 <search-box></search-box>
26 </div>
27 </algolia-query-provider>
28 `
29 }
30}
31β
32customElements.define('algolia-query-provider', AlgoliaQueryProvider)
33customElements.define('algolia-app', AlgoliaApp)