Skip to content

Latest commit

 

History

History
42 lines (36 loc) · 1.25 KB

migration-guide.md

File metadata and controls

42 lines (36 loc) · 1.25 KB

Migration Guide from saschatimme/elm-phoenix library

Unfortunately due to the lack of an Elm 0.19 native Websocket library and the removal of Effects Managers in Elm 0.19, the implementation is not as clean for the user of the library, and probably not as performant either. Therefore a lot of additional wiring as described in the README is now required. The changes described below are also necessary.

Additionally be aware of functionality not yet implemented as described in the README.

Endpoint url

Remove /websocket from end of endpoint as phoenix.js adds this itself

Change to Phoenix.connect

This no longer takes the socket and a list of channels to generate the subscription. Instead it takes phoenixConfig (as described in the README)

Phoenix.connect phoenixConfig

Change to Phoenix.push

The signature has changed from:

push : String -> Push msg -> Cmd msg

to

push : Phoenix.Config msg -> Push msg -> Cmd msg

Therefore change your push functions:

Before:

  Phoenix.push endpoint myPush

to:

  Phoenix.push phoenixConfig myPush

Reconnection logic

If the connection terminates abnormally, reconnection is automatically handled by the phoenix.js so there is no need to do this explicitly.