File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
packages/signals/signals/src/core
signal-generators/dom-gen Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,27 @@ export interface EmitSignal {
66 emit : ( signal : Signal ) => void
77}
88
9+ const logSignal = ( signal : Signal ) => {
10+ logger . info (
11+ 'New signal:' ,
12+ signal . type ,
13+ signal . data ,
14+ signal . type === 'interaction'
15+ ? {
16+ value : signal . data . target . value ,
17+ changedAttribute : signal . data . target . changedAttribute ,
18+ changedValue : signal . data . target . changedValue ,
19+ }
20+ : undefined
21+ )
22+ }
23+
924export class SignalEmitter implements EmitSignal {
1025 private emitter = new Emitter < { add : [ Signal ] } > ( )
1126 private listeners = new Set < ( signal : Signal ) => void > ( )
1227
1328 emit ( signal : Signal ) {
14- logger . info ( 'New signal:' , signal . type , signal . data )
29+ logSignal ( signal )
1530 this . emitter . emit ( 'add' , signal )
1631 }
1732
Original file line number Diff line number Diff line change @@ -272,9 +272,7 @@ export class OnChangeGenerator implements SignalGenerator {
272272 changedValue : ev . newValue ,
273273 changedAttribute : ev . attributeName ,
274274 } ,
275- metadata : {
276- listener : 'mutation-observer' ,
277- } ,
275+ listener : 'mutation-observer' ,
278276 } )
279277 )
280278 } )
@@ -296,9 +294,7 @@ export class OnChangeGenerator implements SignalGenerator {
296294 changedValue : el . value ,
297295 changedAttribute : 'value' ,
298296 } ,
299- metadata : {
300- listener : 'on-change' ,
301- } ,
297+ listener : 'on-change' ,
302298 } )
303299 )
304300 } , 300 )
You can’t perform that action at this time.
0 commit comments