MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / RunWork

Method RunWork

tsunami/engine/rootelem.go:390–416  ·  view source on GitHub ↗

this will be called by the frontend to say the DOM has been mounted it will eventually send any updated "refs" to the backend as well

(opts *RenderOpts)

Source from the content-addressed store, hash-verified

388// this will be called by the frontend to say the DOM has been mounted
389// it will eventually send any updated "refs" to the backend as well
390func (r *RootElem) RunWork(opts *RenderOpts) {
391 workQueue := r.EffectWorkQueue
392 r.EffectWorkQueue = nil
393 // first, run effect cleanups
394 for _, work := range workQueue {
395 comp := r.CompMap[work.WaveId]
396 if comp == nil {
397 continue
398 }
399 hook := comp.Hooks[work.EffectIndex]
400 r.runEffectUnmount(work, hook)
401 }
402 // now run, new effects
403 for _, work := range workQueue {
404 comp := r.CompMap[work.WaveId]
405 if comp == nil {
406 continue
407 }
408 hook := comp.Hooks[work.EffectIndex]
409 r.runEffect(work, hook)
410 }
411 // now check if we need a render
412 renderIds := r.getAndClearRenderWork()
413 if len(renderIds) > 0 {
414 r.render(r.Root.Elem, &r.Root, "root", opts)
415 }
416}
417
418func (r *RootElem) UpdateRef(updateRef rpctypes.VDomRefUpdate) {
419 refId := updateRef.RefId

Callers 2

fullRenderMethod · 0.45
incrementalRenderMethod · 0.45

Calls 4

runEffectUnmountMethod · 0.95
runEffectMethod · 0.95
getAndClearRenderWorkMethod · 0.95
renderMethod · 0.95

Tested by

no test coverage detected