Lavash.Lifecycle.Runtime (Lavash v0.4.0-rc.3)

Copy Markdown View Source

Runtime support for lifecycle DSL blocks (messages do message ... end end today; mount/handle_params/connected blocks if/when they land).

The compiled message clause arrives here with the user's module, the post-body socket, and any state fields written via set. We mark those fields dirty, recompute the reactive graph, and project derived values — same discipline handle_event ends with.

Summary

Functions

Finalises the socket after a message clause body has run.

Functions

finalize(module, socket, touched_state_fields)

Finalises the socket after a message clause body has run.

Marks any fields in touched_state_fields as dirty (so the reactive graph notices), runs Reactive.recompute/1, then Assigns.project/2. Returns the standard {:noreply, socket} tuple Phoenix expects.