Skip to content

Comments

feat(utils): new util optimizeBatchPatch#22

Merged
fratzinger merged 1 commit intomainfrom
feat/optimizeBatchPatch
Dec 11, 2023
Merged

feat(utils): new util optimizeBatchPatch#22
fratzinger merged 1 commit intomainfrom
feat/optimizeBatchPatch

Conversation

@fratzinger
Copy link
Owner

  it("optimizeBatchPatch", () => {
    const items = new Map<Id, Record<string, unknown>>([
      ["1", { name: "John" }],
      ["2", { name: "Jane" }],
      ["3", { name: "John" }],
      ["4", { name: "Jane" }],
      [5, { name: "Jack" }],
    ]);

    expect(optimizeBatchPatch(items)).toEqual([
      [null, { name: "John" }, { query: { id: { $in: ["1", "3"] } } }],
      [null, { name: "Jane" }, { query: { id: { $in: ["2", "4"] } } }],
      [5, { name: "Jack" }, undefined],
    ]);
  });

@fratzinger fratzinger merged commit 4d62c43 into main Dec 11, 2023
@fratzinger fratzinger deleted the feat/optimizeBatchPatch branch December 11, 2023 21:48
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