Skip to content

feat: Add batchedQuery#554

Open
lxsmnsyc wants to merge 9 commits intomainfrom
feat-batched-query
Open

feat: Add batchedQuery#554
lxsmnsyc wants to merge 9 commits intomainfrom
feat-batched-query

Conversation

@lxsmnsyc
Copy link
Member

@lxsmnsyc lxsmnsyc commented Mar 3, 2026

Example

const sleep = (value, ms) => new Promise((res) => setTimeout(res, ms, value));

const example = batchedQuery(async (queries) => {
  const map = new Map();

  for (const query of queries) {
    map.set(query, `hello, ${query}`);
  }

  return await sleep(map, 500);
}, (data, query) => data.get(query));

async function test() {
  const results = await Promise.all([
    example('foo'),
    example('bar'),
  ]);
  console.log(results);
}

@changeset-bot
Copy link

changeset-bot bot commented Mar 3, 2026

⚠️ No Changeset found

Latest commit: 28f350d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@lxsmnsyc lxsmnsyc marked this pull request as draft March 3, 2026 01:17
@lxsmnsyc lxsmnsyc marked this pull request as ready for review March 4, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant