refactor: enhance image preloading logic in InlineCssPlugin for better performance and clarity

This commit is contained in:
sebseb7
2025-07-23 08:52:53 +02:00
parent cee69c9a31
commit c906e0c936
2 changed files with 17 additions and 14 deletions

View File

@@ -28,17 +28,13 @@ class SocketManager {
}
this.pendingListeners.get(event).add(callback);
// If not already connecting, initiate connection
if (!this.connectPromise) {
this.connect();
}
// Register the listener now, it will receive events once connected
this.socket.on(event, callback);
}
off(event, callback) {
// Remove from socket listeners
console.log('off', event, callback);
this.socket.off(event, callback);
// Remove from pending listeners if present