Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions grafast/grafast/__tests__/dcc/dcc-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,9 +738,12 @@ export const batchGetLootDataByItemTypeAndId: LoadManyCallback<
never,
Database
> = (identifiersList, { shared: data }) => {
return identifiersList.map(([type, id]) =>
data.lootData.filter((c) => c.itemType === type && c.itemId === id),
);
return identifiersList.map(([type, id]) => {
const items = data.lootData.filter(
(c) => c.itemType === type && c.itemId === id,
);
return Math.random() > 0.5 ? Promise.resolve(items) : items;
});
};

export const batchGetLootDataByLootBoxId: LoadManyCallback<
Expand Down
2 changes: 1 addition & 1 deletion grafast/grafast/src/steps/loadMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export type LoadManyCallback<
(
lookups: ReadonlyArray<TLookup>,
info: LoadManyInfo<TItem, TParams, TShared>,
): PromiseOrDirect<ReadonlyArray<TData>>;
): PromiseOrDirect<ReadonlyArray<PromiseOrDirect<TData>>>;
displayName?: string;
};

Expand Down
2 changes: 1 addition & 1 deletion grafast/grafast/src/steps/loadOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type LoadOneCallback<
(
specs: ReadonlyArray<TSpec>,
info: LoadOneInfo<TItem, TParams, TUnarySpec>,
): PromiseOrDirect<ReadonlyArray<TData>>;
): PromiseOrDirect<ReadonlyArray<PromiseOrDirect<TData>>>;
displayName?: string;
};

Expand Down
Loading