We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5cb93c commit cea049dCopy full SHA for cea049d
readme.md
@@ -106,3 +106,29 @@ In this example:
106
# Snippets
107
108
## How to deal with dark/light mode
109
+
110
+## EventTarget as a global storage
111
112
+Why to use it?
113
114
+- A way of communication between components
115
+- Source of the truth
116
+- Implement subscriber/listener pattern
117
118
+Interface
119
120
+```js
121
+interface EventTarget {
122
+ addEventListener(
123
+ type: string,
124
+ callback: EventListenerOrEventListenerObject | null,
125
+ options?: AddEventListenerOptions | boolean
126
+ ): void;
127
+ dispatchEvent(event: Event): boolean;
128
+ removeEventListener(
129
130
131
+ options?: EventListenerOptions | boolean
132
133
+}
134
+```
0 commit comments