The lit element life cycle methods that take a changedProperties
argument that is either of type Map<string, any>
or a PropertyValues<this>
.
Just curious is it possible to develop a more generic type in Typescript that can be used to return correctly typed values from a map?
Something like Properties<E>
, that if for example E
is a Todo
with a date:Date
property on it, we could pass properties: Properties<Todo>
in to a function and call something like:
const date:Date = properties.get('date');
And this would lint correctly ….