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

Function ContextGetUpdate

pkg/waveobj/ctxupdate.go:60–72  ·  view source on GitHub ↗
(ctx context.Context, oref ORef)

Source from the content-addressed store, hash-verified

58}
59
60func ContextGetUpdate(ctx context.Context, oref ORef) *WaveObjUpdate {
61 updatesVal := ctx.Value(waveObjUpdateKey)
62 if updatesVal == nil {
63 return nil
64 }
65 updates := updatesVal.(*contextUpdatesType)
66 for idx := len(updates.UpdatesStack) - 1; idx >= 0; idx-- {
67 if obj, ok := updates.UpdatesStack[idx][oref]; ok {
68 return &obj
69 }
70 }
71 return nil
72}
73
74func ContextAddUpdate(ctx context.Context, update WaveObjUpdate) {
75 updatesVal := ctx.Value(waveObjUpdateKey)

Callers

nothing calls this directly

Calls 1

ValueMethod · 0.80

Tested by

no test coverage detected