MCPcopy Index your code
hub / github.com/Effect-TS/effect / handleNext

Function handleNext

packages/experimental/src/EventJournal.ts:430–448  ·  view source on GitHub ↗
(state: IteratorResult<RemoteEntry, void>)

Source from the content-addressed store, hash-verified

428 const remotes = tx.objectStore("remotes")
429 const iterator = options.entries[Symbol.iterator]()
430 const handleNext = (state: IteratorResult<RemoteEntry, void>) => {
431 if (state.done) return
432 const remoteEntry = state.value
433 const entry = remoteEntry.entry
434 entries.get(entry.id).onsuccess = (event) => {
435 if ((event.target as any).result) {
436 remotes.put({
437 remoteId: options.remoteId,
438 entryId: remoteEntry.entry.id,
439 sequence: remoteEntry.remoteSequence
440 })
441 handleNext(iterator.next())
442 return
443 }
444 uncommitted.push(entry)
445 uncommittedRemotes.push(remoteEntry)
446 handleNext(iterator.next())
447 }
448 }
449 handleNext(iterator.next())
450 tx.oncomplete = () => resume(Effect.void)
451 tx.onerror = () =>

Callers 1

makeIndexedDbFunction · 0.85

Calls 3

putMethod · 0.80
getMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected