on develop help sign in
Adds lenses for `RawWebSocket`.
08f7964Dave Laing
reflex-dom-core/src/Reflex/Dom/WebSocket.hs+17
@@ -130,6 +130,7 @@ webSocket' url config onRawMessage = do
130
130
131#ifdef USE_TEMPLATE_HASKELL
131#ifdef USE_TEMPLATE_HASKELL
132makeLensesWith (lensRules & simpleLenses .~ True) ''WebSocketConfig
132makeLensesWith (lensRules & simpleLenses .~ True) ''WebSocketConfig
133+makeLensesWith (lensRules & simpleLenses .~ True) ''RawWebSocket
133#else
134#else
134
135
135webSocketConfig_send :: Lens' (WebSocketConfig t a) (Event t [a])
136webSocketConfig_send :: Lens' (WebSocketConfig t a) (Event t [a])
@@ -144,4 +145,20 @@ webSocketConfig_reconnect :: Lens' (WebSocketConfig t a) Bool
144webSocketConfig_reconnect f (WebSocketConfig x1 x2 x3) = (\y -> WebSocketConfig x1 x2 y) <$> f x3
145webSocketConfig_reconnect f (WebSocketConfig x1 x2 x3) = (\y -> WebSocketConfig x1 x2 y) <$> f x3
145{-# INLINE webSocketConfig_reconnect #-}
146{-# INLINE webSocketConfig_reconnect #-}
146
147
148+webSocket_recv :: Lens' (RawWebSocket t a) (Event t a)
149+webSocket_recv f (WebSocket x1 x2 x3 x4) = (\y -> WebSocket y x2 x3 x4) <$> f x1
150+{-# INLINE webSocket_recv #-}
151+
152+webSocket_open :: Lens' (RawWebSocket t a) (Event t ())
153+webSocket_open f (WebSocket x1 x2 x3 x4) = (\y -> WebSocket x1 y x3 x4) <$> f x2
154+{-# INLINE webSocket_open #-}
155+
156+webSocket_error :: Lens' (RawWebSocket t a) (Event t ())
157+webSocket_error f (WebSocket x1 x2 x3 x4) = (\y -> WebSocket x1 x2 y x4) <$> f x3
158+{-# INLINE webSocket_error #-}
159+
160+webSocket_close :: Lens' (RawWebSocket t a) (Event t (Bool, Word, Text))
161+webSocket_close f (WebSocket x1 x2 x3 x4) = (\y -> WebSocket x1 x2 x3 y) <$> f x4
162+{-# INLINE webSocket_close #-}
163+
147#endif
164#endif