Use efficient filters
This commit is contained in:
parent
07cb8491e2
commit
3f2ecfb0b6
13 changed files with 82 additions and 47 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { MAX_LOG_MESSAGE_COUNT } from "../consts";
|
||||
import { removeFromArray } from "../utils/remove-from-array";
|
||||
|
||||
export enum LogLevel {
|
||||
DEBUG = "DEBUG",
|
||||
|
|
@ -63,10 +64,7 @@ export class Logger {
|
|||
public removeOnMessageListener(
|
||||
listener: (message: LogLine) => unknown
|
||||
): void {
|
||||
const index = this.onMessageListeners.indexOf(listener);
|
||||
if (index !== -1) {
|
||||
this.onMessageListeners.splice(index, 1);
|
||||
}
|
||||
removeFromArray(this.onMessageListeners, listener);
|
||||
}
|
||||
|
||||
public reset(): void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue