surface-ui / surface

A server-side rendering component library for Phoenix
https://surface-ui.org
MIT License
2.08k stars 150 forks source link

Fix Context.get/put in LiveComponent update #691

Closed tiagoefmoraes closed 1 year ago

tiagoefmoraes commented 1 year ago

Allow calling Context.get(socket, :field) and Context.put(socket, field: "value") in update/2

Calling it giving assigns will not work because there's no context information there. It's different from a render/1 assigns.

If the user is defining props or datas with from_context they will have to call assign(socket, assigns) for them to be updated (as with any other assigns).

msaraiva commented 1 year ago

@tiagoefmoraes thank you!