Releases: saschatimme/elm-phoenix
Releases · saschatimme/elm-phoenix
Support for multiple websockets
Expose Phoenix.Presence
Merge pull request #34 from jaimevelaz/master Include `Phoenix.Presence` in `exposed-modules`
Presence Support
This adds:
- Presence Support (based on the work by @jur0)
- Better permission deny handling by @opsb.
Add map functions
This release just adds
Channel.map: (a -> b) -> Channel a -> Channel b
and
Socket.map: (a -> b) -> Socket a -> Socket b
Callbacks for the socket connection
Based on the PR #5 from @opsb there are three new callbacks in Phoenix.Socket
:
{-| Set a callback which will be called if the socket connection got closed abnormal, i.e.,
if the server declined the socket authentication. So this callback is useful for updating
query params like access tokens.
type Msg =
RefreshAccessToken | ...
init "ws://localhost:4000/socket/websocket"
|> withParams [ ( "accessToken", "abc123" ) ]
|> onAbnormalClose RefreshAccessToken
-}
onAbnormalClose : msg -> Socket msg -> Socket msg
{-| Set a callback which will be called if the socket connection got closed normal. Useful if
you have to do some additional clean up.
-}
onNormalClose : msg -> Socket msg -> Socket msg
{-| Set a callback which will be called if the socket connection got closed.
You can learn more about the code [here](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent).
-}
onClose : ({ code : Int, reason : String, wasClean : Bool } -> msg) -> Socket msg -> Socket msg
This also resulted in a change of the Socket
type from Socket
to Socket msg
.
Elm 0.18
This updates to source code to Elm 0.18.