slender_channel v0.1.1 SlenderChannel

Exposes helpful macros for working with Phoenix Channels

Summary

Functions

Defines a handle_in/3 callback that pattern matches the given event and payload, broadcasting them in turn

Functions

handle_in_and_broadcast(event, payload) (macro)

Defines a handle_in/3 callback that pattern matches the given event and payload, broadcasting them in turn:

handle_in_and_broadcast "bobby_dumped_stacy", %{"pettiness" => 10}

Becomes:

def handle_in("bobby_dumped_stacy", %{"pettiness" => 10}, socket) do
  broadcast! socket, "bobby_dumped_stacy", %{"pettiness" => 10}
  {:noreply, socket}
end