This module is for working with Phoenix Presence.
Before you can receive presence information, you first need to connect to a socket and join a channel. Once this is done, you can then subscribe to start receiving Presence data as your users come and go.
If you are new to Phoenix Presence, you will need to setup your backend
channel as described
here.
Currently, only the metas key is supported.
All of the presence events that can come from the channel.
If you are using more than one channel, then you can check Topic to determine
which channel the EventIn relates to. If you are only using a single
channel, you can ignore Topic.
InvalidEvent means that an event has been received from the accompanying JS
that cannot be handled. This should not happen, if it does, please raise an
issue.
A type alias representing the channel topic. Use this to identify the channel an EventIn relates to.
If you are only using one channel, you can ignore this.
A type alias representing a list of all Presences stored on the channel.
A type alias representing the joins and leaves on the channel as they
happen.
A type alias representing the port function required to receive
the EventIn from the channel.
You could write this yourself, if you do, it needs to be named
presenceReceiver, although you may find it simpler to just add
this port module
to your src - it includes all the necessary port functions.
A type alias representing the data received from a channel. You will not use this directly.
Decode the metas for a Presence.
Only you will know what meta information you are storing, so you will need to
provide your own decoder.
Subscribe to receive incoming presence events.