I want to add a few data into socket but wondering what the best way to do that would be.
Instead of doing a bunch of
socket = assign(socket, :channel_id, channel_id)
I want to add a few data into socket but wondering what the best way to do that would be.
Instead of doing a bunch of
socket = assign(socket, :channel_id, channel_id)
Copyright © 2021 Jogjafile Inc.
There is an alternative function
assign/2that allows assigning multiple values at once, by passing either map or keyword list: