File tree 1 file changed +12
-8
lines changed
libs/state/actions/src/lib
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* @description
3
3
* This transform is a side effecting operation applying `preventDefault` to a passed Event
4
- * @param e
5
4
*/
6
5
export function preventDefault ( e : Event ) : Event {
7
6
e . preventDefault ( ) ;
@@ -11,7 +10,6 @@ export function preventDefault(e: Event): Event {
11
10
/**
12
11
* @description
13
12
* This transform is a side effecting operation applying `stopPropagation` to a passed Event
14
- * @param e
15
13
*/
16
14
export function stopPropagation ( e : Event ) : Event {
17
15
e . stopPropagation ( ) ;
@@ -21,24 +19,30 @@ export function stopPropagation(e: Event): Event {
21
19
/**
22
20
* @description
23
21
* This transform is a side effecting operation applying `preventDefault` and `stopPropagation` to a passed Event
24
- * @param e
25
22
*/
26
23
export function preventDefaultStopPropagation ( e : Event ) : Event {
27
24
e . stopPropagation ( ) ;
28
25
e . preventDefault ( ) ;
29
26
return e ;
30
27
}
31
28
32
-
33
29
/**
34
30
* @description
35
- * This transform is helps to pluck values from DOM `Event` or forward the value directly.
36
- * @param e
31
+ * This transform helps to pluck values from DOM `Event` or forward the value directly.
37
32
*/
38
33
export function eventValue < T = string > ( e : Event | T ) : T {
39
34
// Consider https://stackoverflow.com/questions/1458894/how-to-determine-if-javascript-object-is-an-event
40
- if ( ( e as unknown as { target : { value : T } } ) ?. target ) {
41
- return ( e as unknown as { target : { value : T } } ) ?. target ?. value ;
35
+ if ( ( e as unknown as { target : { value : T } } ) ?. target ) {
36
+ return ( e as unknown as { target : { value : T } } ) ?. target ?. value ;
42
37
}
43
38
return e as T ;
44
39
}
40
+
41
+ /**
42
+ * @description
43
+ * This transform helps to void all arguments.
44
+ */
45
+ export function toVoid ( _ ?: unknown ) : void {
46
+ _ ;
47
+ return void 0 ;
48
+ }
You can’t perform that action at this time.
0 commit comments