Skip to content

UI does not render until all items are retrieved when executing a slow Sourceย #32

@tennashi

Description

@tennashi

When executing a Source that takes a long time to retrieve items (e.g., fetching a large dataset over a network), the UI does not render anything until all items have been retrieved.

Is this the expected behavior?

function test(): Source<never> {
  return defineSource(async function* (_denops) {
    let id = 0;
    while (true) {
      yield {
        id: id++,
        value: "hoge",
      }
      await new Promise(resolve => setTimeout(resolve, 1000));
    }
  });
}

definePickerFromSource(
  "test",
  test,
  {
    matchers: [builtin.matcher.fzf],
    actions: {
      ...myPathActions,
    },
    defaultAction: "cd",
  },
);

I expect the items to be rendered every second.

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