MCPcopy Create free account
hub / github.com/anomalyco/opencode / applyOptimisticRemove

Function applyOptimisticRemove

packages/app/src/context/sync.tsx:103–110  ·  view source on GitHub ↗
(draft: OptimisticStore, input: OptimisticRemoveInput)

Source from the content-addressed store, hash-verified

101}
102
103export function applyOptimisticRemove(draft: OptimisticStore, input: OptimisticRemoveInput) {
104 const messages = draft.message[input.sessionID]
105 if (messages) {
106 const result = Binary.search(messages, input.messageID, (m) => m.id)
107 if (result.found) messages.splice(result.index, 1)
108 }
109 delete draft.part[input.messageID]
110}
111
112export const useSync = () => {
113 const serverSync = useServerSync()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected