What is Nostr?
Anthony Accioly
npub1a6w…0tyc
2025-03-12 18:17:50
in reply to nevent1q…jkw2

Anthony Accioly on Nostr: Got it. fetchEvents is just a wrapper over subscribe with closeOnEose anyway (see ...

Got it. fetchEvents is just a wrapper over subscribe with closeOnEose anyway (see https://github.com/nostr-dev-kit/ndk/blob/master/ndk/src/ndk/index.ts#L707-L712 ). Not the cleanest workaround, but if you don't want to go down to the subscribe level you can always wrap or copy and paste fetchEvents to your own "fetchEventsWithTimeout" function, e.g. you can use Promise.race between fetchEvents and a timeout promise that automatically rejects the promise after a certain amount of time.
Author Public Key
npub1a6we08n7zsv2na689whc9hykpq4q6sj3kaauk9c2dm8vj0adlajq7w0tyc