A small decorator for the JavaScript WebSocket API that automatically reconnects