refactor: enhance image preloading logic in InlineCssPlugin for better performance and clarity
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user