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

Function ContextGetUpdates

pkg/waveobj/ctxupdate.go:42–58  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

40}
41
42func ContextGetUpdates(ctx context.Context) map[ORef]WaveObjUpdate {
43 updatesVal := ctx.Value(waveObjUpdateKey)
44 if updatesVal == nil {
45 return nil
46 }
47 updates := updatesVal.(*contextUpdatesType)
48 if len(updates.UpdatesStack) == 1 {
49 return updates.UpdatesStack[0]
50 }
51 rtn := make(map[ORef]WaveObjUpdate)
52 for _, update := range updates.UpdatesStack {
53 for k, v := range update {
54 rtn[k] = v
55 }
56 }
57 return rtn
58}
59
60func ContextGetUpdate(ctx context.Context, oref ORef) *WaveObjUpdate {
61 updatesVal := ctx.Value(waveObjUpdateKey)

Callers 1

ContextGetUpdatesRtnFunction · 0.85

Calls 1

ValueMethod · 0.80

Tested by

no test coverage detected