diff --git a/src/index.js b/src/index.js index 7fac33e..1e01908 100644 --- a/src/index.js +++ b/src/index.js @@ -244,7 +244,7 @@ export class BlockstoreDatastoreAdapter extends BaseBlockstore { // process.nextTick runs on the microtask queue, setImmediate runs on the next // event loop iteration so is slower. Use process.nextTick if it is available. - const runner = process && process.nextTick ? process.nextTick : setImmediate + const runner = globalThis.process && globalThis.process.nextTick ? globalThis.process.nextTick : (globalThis.setImmediate || globalThis.setTimeout) runner(async () => { try {