@tanstack/db
Version:
A reactive client store for building super fast apps on sync
18 lines (17 loc) • 879 B
JavaScript
import { filter, join, map } from "@tanstack/db-ivm";
var PARENT_ROUTE_CROSS_KEY = `__tanstack_parent_route_cross__`;
function crossJoinParentRoutes(input, parentKeyStream, assemble) {
const rows = input.pipe(map(([rowKey, row, callbackValue]) => [PARENT_ROUTE_CROSS_KEY, [
rowKey,
row,
callbackValue
]]));
const routes = parentKeyStream.pipe(map(([correlationKey, parentContext]) => [PARENT_ROUTE_CROSS_KEY, [correlationKey, parentContext]]));
return rows.pipe(join(routes, `inner`), filter(([, [rowSide, routeSide]]) => Boolean(rowSide != null && routeSide != null)), map(([, [rowSide, routeSide]]) => {
const [rowKey, row, callbackValue] = rowSide;
const [correlationKey, parentContext] = routeSide;
return assemble(rowKey, row, correlationKey, parentContext, callbackValue);
}));
}
export { crossJoinParentRoutes };
//# sourceMappingURL=parent-routes.js.map