pl-fe: support batch translations on supported backends
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@@ -9,8 +9,16 @@ const relationships = memoize((client: PlApiClient) => create({
|
||||
scheduler: bufferScheduler(200),
|
||||
}));
|
||||
|
||||
// TODO: proper multi-client support
|
||||
const translations = memoize((lang: string, client: PlApiClient) => create({
|
||||
fetcher: (ids: string[]) => client.statuses.translateStatuses(ids, lang),
|
||||
resolver: keyResolver('id'),
|
||||
scheduler: bufferScheduler(200),
|
||||
}));
|
||||
|
||||
const batcher = {
|
||||
relationships,
|
||||
translations,
|
||||
};
|
||||
|
||||
export { batcher };
|
||||
|
||||
Reference in New Issue
Block a user