Elm Phoenix Versions Save

An Elm client for Phoenix Channels

0.3.2

6 years ago

Previously things got messy if there were connections to multiple websockets. Thanks to @edennis (#40) this is now resolved :)

0.3.1

6 years ago

0.3.0

7 years ago

This adds:

0.2.1

7 years ago

This release just adds

Channel.map: (a -> b) -> Channel a -> Channel b

and

Socket.map: (a -> b) -> Socket a -> Socket b

0.1.1

7 years ago

This updates to source code to Elm 0.18.

0.2.0

7 years ago

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.