uniqueQueryId.tsx 199 B

1234567891011
  1. export function* getUniqueQueryIdGenerator(
  2. usedIds: Set<number>
  3. ): Generator<number, number> {
  4. let id = 0;
  5. while (true) {
  6. while (usedIds.has(id)) {
  7. id++;
  8. }
  9. yield id++;
  10. }
  11. }