Skip to content

quanterall/purescript-halogen-use-websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purecript-halogen-use-websocket

A hook for using websockets in Halogen. Allows subscription to messages and handlers associated with those messages:

let
  handleWebSocketMessage Increment = Hooks.modify_ _ {value = value + 1}
  handleWebSocketMessage Decrement = Hooks.modify_ _ {value = value - 1}

useWebSocket socket handleWebSocketMessage

useWebSocket requires that your type has a ReadForeign instance, since it will automatically try to decode that type a and act only if it's a valid a.

About

A hook for subscribing to websocket messages

Resources

Stars

Watchers

Forks

Packages

No packages published