8862f0c6b8af75fab68bb8658277147fdc8f420d
- Removed unused imports related to ventilation types and updated the product selection logic to dynamically filter ventilation options based on the selected tent shape. - Implemented new methods to retrieve and filter available ventilation products, enhancing the user experience by ensuring only relevant options are displayed. - Updated the UI to reflect the selected tent shape and provide feedback when no matching ventilation products are available. - Improved overall rendering of the ventilation section with better styling and selection indicators.
Schnellstart
Voraussetzungen
- Node.js herunterladen: nodejs.org - LTS-Version installieren
- VSCode herunterladen: code.visualstudio.com - Stabile Version installieren
Entpacken & Doppelklick auf start-dev-seedheads.bat - das Skript wird:
- Abhängigkeiten automatisch installieren falls nötig
- Entwicklungsserver mit API-Proxy zu seedheads.de starten
- Browser öffnen auf http://localhost:9500
Socket Connection Optimization
The application uses Socket.IO for real-time communication with the server. To improve initial loading performance, sockets are now connected lazily:
- Sockets are created with
autoConnect: falseand only establish a connection when:- The first
emitis called on the socket - An explicit connection is requested via the context methods
- The first
Usage
// In a component
import React, { useContext, useEffect } from 'react';
import SocketContext from '../contexts/SocketContext';
import { emitAsync } from '../utils/socketUtils';
const MyComponent = () => {
const { socket, socketB } = useContext(SocketContext);
useEffect(() => {
// The socket will automatically connect when emit is called
socket.emit('someEvent', { data: 'example' });
// Or use the utility for Promise-based responses
emitAsync(socket, 'getData', { id: 123 })
.then(response => console.log(response))
.catch(error => console.error(error));
}, [socket]);
return <div>My Component</div>;
};
Benefits
- Reduced initial page load time
- Connections established only when needed
- Automatic fallback to polling if WebSocket fails
- Promise-based utilities for easier async/await usage
Languages
JavaScript
99.8%