UNPKG

@tanstack/db

Version:

A reactive client store for building super fast apps on sync

18 lines (17 loc) • 1.01 kB
let _tanstack_db_ivm = require("@tanstack/db-ivm"); var PARENT_ROUTE_CROSS_KEY = `__tanstack_parent_route_cross__`; function crossJoinParentRoutes(input, parentKeyStream, assemble) { const rows = input.pipe((0, _tanstack_db_ivm.map)(([rowKey, row, callbackValue]) => [PARENT_ROUTE_CROSS_KEY, [ rowKey, row, callbackValue ]])); const routes = parentKeyStream.pipe((0, _tanstack_db_ivm.map)(([correlationKey, parentContext]) => [PARENT_ROUTE_CROSS_KEY, [correlationKey, parentContext]])); return rows.pipe((0, _tanstack_db_ivm.join)(routes, `inner`), (0, _tanstack_db_ivm.filter)(([, [rowSide, routeSide]]) => Boolean(rowSide != null && routeSide != null)), (0, _tanstack_db_ivm.map)(([, [rowSide, routeSide]]) => { const [rowKey, row, callbackValue] = rowSide; const [correlationKey, parentContext] = routeSide; return assemble(rowKey, row, correlationKey, parentContext, callbackValue); })); } exports.crossJoinParentRoutes = crossJoinParentRoutes; //# sourceMappingURL=parent-routes.cjs.map