Skip to content

Releases: saschatimme/elm-phoenix

Support for multiple websockets

29 Nov 08:41
584ecbb
Compare
Choose a tag to compare

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

Expose Phoenix.Presence

27 Aug 17:29
Compare
Choose a tag to compare
Merge pull request #34 from jaimevelaz/master

Include `Phoenix.Presence` in `exposed-modules`

Presence Support

03 May 10:54
Compare
Choose a tag to compare

This adds:

Add map functions

26 Feb 09:04
Compare
Choose a tag to compare

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

19 Nov 11:02
Compare
Choose a tag to compare

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

19 Nov 12:36
Compare
Choose a tag to compare

This updates to source code to Elm 0.18.