summaryrefslogtreecommitdiff
path: root/examples/snowpack/src/components/docsearch.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/snowpack/src/components/docsearch.js')
-rw-r--r--examples/snowpack/src/components/docsearch.js31
1 files changed, 17 insertions, 14 deletions
diff --git a/examples/snowpack/src/components/docsearch.js b/examples/snowpack/src/components/docsearch.js
index d7ae95f30..f2b9e6441 100644
--- a/examples/snowpack/src/components/docsearch.js
+++ b/examples/snowpack/src/components/docsearch.js
@@ -1,17 +1,20 @@
import docsearch from 'docsearch.js/dist/cdn/docsearch.min.js';
-customElements.define('doc-search', class extends HTMLElement {
- connectedCallback() {
- if(!this._setup) {
- const apiKey = this.getAttribute('api-key');
- const selector = this.getAttribute('selector');
- docsearch({
- apiKey: apiKey,
- indexName: 'snowpack',
- inputSelector: selector,
- debug: true // Set debug to true if you want to inspect the dropdown
- });
- this._setup = true;
+customElements.define(
+ 'doc-search',
+ class extends HTMLElement {
+ connectedCallback() {
+ if (!this._setup) {
+ const apiKey = this.getAttribute('api-key');
+ const selector = this.getAttribute('selector');
+ docsearch({
+ apiKey: apiKey,
+ indexName: 'snowpack',
+ inputSelector: selector,
+ debug: true, // Set debug to true if you want to inspect the dropdown
+ });
+ this._setup = true;
+ }
}
- }
-}); \ No newline at end of file
+ },
+);