You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# ModAPI.removeEventListener(String eventName, Function callback, Boolean slow?)
2
+
This method is used to add event listeners to the event name specified.
3
+
4
+
## Arguments:
5
+
6
+
### (String) eventName
7
+
Type of event to remove the listener from. Types of events are listed [here](addEventListener.md)
8
+
9
+
### (Function) callback
10
+
The function to remove from the event listener array.
11
+
12
+
### [Optional] (Boolean) slow
13
+
Wether or not to use the functions definition rather than it's reference to look in the listener array. Much slower with it on, but still fast. Do not use if events need to be added and removed rapidly.
14
+
15
+
Example where it is not necessary:
16
+
```
17
+
function myListener() {
18
+
// idk
19
+
}
20
+
ModAPI.addEventListener("update", myListener);
21
+
ModAPI.removeEventListener("update", myListener);
22
+
```
23
+
24
+
Example where it is necessary:
25
+
```
26
+
ModAPI.addEventListener("update", function myListener() {
27
+
// idk
28
+
});
29
+
ModAPI.removeEventListener("update", function myListener() {
0 commit comments