-If I assign a previously non-existent assign, it will be added to the list of existing assigns
-If I assign an assign that already exsists, it will be updated/replaced
-Any other already existing assigns that are not mentioned in my assign/3 call will remain unaffected
Also, something I’ve learned yesterday, which might be obvious: the update/2 callback on LiveComponent is called only when the parent updates any assign on the component, or calls send_update on it. It will not be called during assign/3.
Example:
## In Parent
# Component.update/2 called whenever `foo` changes
<%= live_component @socket, Component, id: "component", foo: @foo %>
# Component.update/2 called here as well
send_update(Component, id: "component", foo: :bar)
## In Component
# Component.update/2 not called here
assign(socket, :foo, :baz)