Hi!
Is there an opposite of assign(socket ...)
?
i’m looking to remove an assigns from the socket, but the only solution i’m seeing is setting the assigns value to nil
I tried this, but it didn’t work for me:
Hi!
Is there an opposite of assign(socket ...)
?
i’m looking to remove an assigns from the socket, but the only solution i’m seeing is setting the assigns value to nil
I tried this, but it didn’t work for me:
Hello,
assigns is a Map
, so it should work
%{
socket
| assigns: Map.delete(socket.assigns, :key),
changed: Map.put_new(socket.changed, :key, true)
}
Ah, I missed the changed
part. Thanks!!
Seems that as of now (Dec 2022), the :changed
key is no longer in the socket
struct, and is no longer necessary?