Skip to content

onEvents callback never called from ndk.subscribe() #364

@ryanjagger

Description

@ryanjagger

The only way I can get onEvents to be fired is by using v3 beta (but the returned events is empty Array (using cache-dexie or not)

https://codesandbox.io/p/sandbox/unruffled-sound-8hn568

const subscription = ndk.subscribe(
    { kinds: [1] },
    {
      closeOnEose: true,
    },
    {
      onEose: () => console.log("End of stream"),
      onEvent: (event) => console.log("onEvent", event),
      onEvents: (events) =>
        console.log("onEvents - never gets called", events.length),
    }
  );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions