The reconciler of Lumen: it mounts a tree of elements into a panel, creating a vgui panel for every intrinsic element and rendering every component, and later brings the panels in line with a new tree, updating the props of the panels that are still there, creating the ones that are new and removing the ones that are gone. Elements of a list are matched by their key prop, or by their position when they have none. Components whose state changes are rendered again on the next frame, and only their part of the tree is reconciled.

local root = Lumen.mount(Lumen.element(Lumen.component('help')), parent_panel)

root:update(Lumen.element(Lumen.component('help'), { page = 'credits' }))
root:unmount()

Summary

Functions

flush()client
Renders the components whose state has changed since the last frame and runs the effects that follow.
Checks whether a render is pending.
Queues an effect to run once the current render has been committed.
Marks a component for a render on the next frame.

Functions

Lumen.Reconciler.flush()

client packages/lumen/lib/cl_reconciler.lua:435

Renders the components whose state has changed since the last frame and runs the effects that follow. Runs by itself on the frame after a change; call it to apply changes at once.

Lumen.Reconciler.is_pending()

client packages/lumen/lib/cl_reconciler.lua:467

Checks whether a render is pending.

Returns

  • Boolean

Lumen.Reconciler.queue_effect(instance, slot)

client packages/lumen/lib/cl_reconciler.lua:414

Queues an effect to run once the current render has been committed.

Parameters

  • instance Map the component instance the effect belongs to
  • slot Map the hook slot of the effect

Lumen.Reconciler.schedule(instance)

client packages/lumen/lib/cl_reconciler.lua:420

Marks a component for a render on the next frame. Called when its state changes.

Parameters

  • instance Map component instance

Defined in