File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/lit-helper/src/directives Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,18 @@ import {GecutLogger} from '@gecut/logger';
22import { AsyncDirective , PartType } from 'lit-html/async-directive.js' ;
33
44import type { Part , PartInfo } from 'lit-html/directive.js' ;
5+ import type { ClassInfo } from 'lit-html/directives/class-map.js' ;
56
67export abstract class GecutAsyncDirective extends AsyncDirective {
7- constructor ( partInfo : PartInfo , debugName : string ) {
8+ constructor ( partInfo : PartInfo , name : string ) {
89 super ( partInfo ) ;
9- this . log = new GecutLogger ( `<${ debugName } >` ) ;
10+ this . name = name ;
11+ this . log = new GecutLogger ( `<${ this . name } >` ) ;
1012
1113 this . log . methodArgs ?.( 'constructor' , Object . keys ( PartType ) [ partInfo . type - 1 ] ) ;
1214 }
1315
16+ protected name ;
1417 protected log ;
1518
1619 override setValue ( value : unknown ) : void {
@@ -32,4 +35,10 @@ export abstract class GecutAsyncDirective extends AsyncDirective {
3235 this . log . method ?.( 'disconnected' ) ;
3336 super . disconnected ( ) ;
3437 }
38+
39+ protected getRenderClasses ( ) : ClassInfo {
40+ return {
41+ [ this . name ] : true ,
42+ } ;
43+ }
3544}
You can’t perform that action at this time.
0 commit comments