Closed dzintars closed 4 years ago
Caused becuse i tried to console.log 'nav-item-mouseover': (e: CustomEvent<NavItemElementData>) => console.log(e.detail.key)
.
Not sure is it limitation of connect library
I'm an idiot. mapEvents()
is not supposed to be used for general custom events interception. You can intercept custom events in the constructor simply by
constructor() {
super()
this.addEventListener('nav-item-mouseover', this.test)
}
mapEvents()
can call only Redux action creators.
ERROR in /home/dzintars/code/github.com/dzintars/front/src/ui/containers/main-launcher/component.ts ./src/ui/containers/main-launcher/component.ts [tsl] ERROR in /home/dzintars/code/github.com/dzintars/front/src/ui/containers/main-launcher/component.ts(38,3) TS2416: Property 'mapEvents' in type 'MainLauncherElement' is not assignable to the same property in base type 'Connectable & LitElement'. Type '() => { 'nav-item-click': (e: CustomEvent) => ApplicationActionTypes; 'nav-item-mouseover': (e: CustomEvent) => void; }' is not assignable to type '() => { [key: string]: (event: Event) => Action; }'.
Type '{ 'nav-item-click': (e: CustomEvent) => ApplicationActionTypes; 'nav-item-mouseover': (e: CustomEvent) => void; }' is not assignable to type '{ [key: string]: (event: Event) => Action; }'.
Property ''nav-item-mouseover'' is incompatible with index signature.
Type '(e: CustomEvent) => void' is not assignable to type '(event: Event) => Action'.
Type 'void' is not assignable to type 'Action'.
ℹ 「wdm」: Failed to compile.