Add init_channels/0 function
init_channels/0 allows to subscribe to given list of channels during the startup of your app.
Example:
defmodule SimpleClient do
use Pushest, otp_app: :simple_client
def init_channels do
[
[name: "public-init-channel", user_data: %{}],
[name: "private-init-channel", user_data: %{}],
[name: "presence-init-channel", user_data: %{user_id: 123}],
]
end
end
Each element of the list has to be a keyword list with name
and user_data
keys with values of following type: [name: String.t(), user_data: map]