Rerouted (retagged, needs approval). The tag now points at a different commit than when this version was published. The Lamdera package server serves a copy recovered from https://github.com/chazsconi/elm-phoenix-ports.
What we checked: Tag 1.0.0 is still on github.com/chazsconi/elm-phoenix-ports; its commit d2dc645ca390 is from 2020-06-07 10:15 UTC, after the version was published (2020-06-07 09:33 UTC); elm.json differs from package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one and nothing else confirms its contents.
We could not verify this copy against what was published, so the Lamdera compiler asks before using it (y/n). Without a terminal, as in CI, it stops with an error unless approved:
lamdera make --auto-approve-package-rerouting approves rerouted versions for that run,LAMDERA_AUTO_APPROVE_PACKAGE_REROUTING=1 does the same for every run in that environment,LAMDERA_CACHE=off skips the Lamdera package server altogether: packages come from package.elm-lang.org and GitHub only, as with elm, and a rerouted version then fails to download.Details · package.elm-lang.org's zip: https://github.com/chazsconi/elm-phoenix-ports/zipball/1.0.0/
A channel declares which topic should be joined, registers event handlers and has various callbacks for possible lifecycle events.
Topic of channel
Initialize a channel to a given topic.
init "room:lobby"Attach a payload to the join message. You can use this to submit e.g. a user id or authentication infos. This will be the second argument in your join/3 callback on the server.
payload =
Json.Encode.object [("user_id", "123")]
init "room:lobby"
|> withPayload payloadRegister an event handler for a event.
type Msg = NewMsg Value | ...
init "roomy:lobby"
|> on "new_msg" NewMsgSet a callback which will be called after you sucessfully joined the channel. It will also be called after you rejoined the channel after a disconnect unless you specified an onRejoin handler.
type Msg =
IsOnline Json.Encode.Value | ...
init "room:lobby"
|> onJoin IsOnlineSet a callback which will be called after you request to join the channel.
type Msg =
JoinLobbyRequested
init "room:lobby"
|> onRequestJoin JoinLobbyRequestedSet a callback which will be called if the server declined your request to join the channel.
type Msg =
CouldNotJoin Json.Encode.Value | ...
init "room:lobby"
|> onJoinError CouldNotJoinNote: If a channel declined a request to join a topic the effect manager won_t try again.
Set a callback which will be called if the channel process on the server crashed. The effect manager will automatically rejoin the channel after a crash.
type Msg =
ChannelCrashed | ...
init "room:lobby"
|> onError ChannelCrashedSet a callback which will be called after you sucessfully left a channel.
type Msg =
LeftLobby Json.Encode.Value | ...
init "room:lobby"
|> onLeave LeftLobbySet a callback which will be called if the server declined your request to left a channel. _(It seems that Phoenix v1.2 doesn_t send this)_
Print all status changes.
Set a callback which will be called when there is a change in the presence state caused by "presence_state" and "presence_diff" events.
type Msg =
PresenceChange (Dict String (List Json.Encode.Value)) | ...
init "room:lobby"
|> onPresenceChange PresenceChangeComposes each callback with the function a -> b.
Representation of a Phoenix Channel