Fix missed rename, and improve types (#276)
Fixes a missed rename, in `src/item-index.ts`: I'd renamed `coll` to `item` but missed updating it in the `update` method's `changedProperties` map. This PR fixes that, and adds better typing to all of the instances of `changedProperties` by using [`PropertyValues<this>`](https://lit.dev/docs/components/lifecycle/#typescript-types-for-changedproperties), and implementing class properties for missing Lit properties.
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
import prettyBytes from "pretty-bytes";
|
||||
|
||||
import { LitElement, html, css, unsafeCSS } from "lit";
|
||||
import { LitElement, html, css, unsafeCSS, type PropertyValues } from "lit";
|
||||
import { property, state } from "lit/decorators.js";
|
||||
|
||||
import "keyword-mark-element/lib/keyword-mark.js";
|
||||
@@ -183,7 +183,7 @@ class PageEntry extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
updated(changedProperties) {
|
||||
updated(changedProperties: PropertyValues<this>) {
|
||||
if (changedProperties.has("page") || changedProperties.has("query")) {
|
||||
this.updateSnippet();
|
||||
this.deleting = false;
|
||||
|
||||
Reference in New Issue
Block a user