ConstElement type produced by the left source iterable.
Element type produced by the right source iterable.
Key type generated by the key selector functions.
Result type emitted by the selector.
Right source iterable evaluated for outer join matches.
Selector producing a key for each left element.
Selector producing a key for each right element.
Projection receiving optional left and right elements plus the shared key.
OptionalmapFactory: MapFactory<TKey>Optional factory used to create the internal map for key lookups.
A deferred iterable yielding the result of selector for each matched key combination.
const result = [..._fullOuterJoin(
[
{ id: 1, label: "L1" },
{ id: 2, label: "L2" }
],
[
{ id: 2, label: "R2" },
{ id: 3, label: "R3" }
],
(left) => left.id,
(right) => right.id,
(left, right, id) => ({
id,
left: left?.label,
right: right?.label
})
)];
console.log(result);
// [
// { id: 1, left: "L1", right: undefined },
// { id: 2, left: "L2", right: "R2" },
// { id: 3, left: undefined, right: "R3" }
// ]
or using the curried version:
const result = pipeInto(
[
{ id: 1, name: "Alice" }
],
fullOuterJoin(
[
{ id: 1, city: "Paris" },
{ id: 2, city: "Rome" }
],
(left) => left.id,
(right) => right.id,
(left, right, id) => ({
id,
name: left?.name ?? null,
city: right?.city ?? null
})
)
);
console.log([...result]);
// [
// { id: 1, name: "Alice", city: "Paris" },
// { id: 2, name: null, city: "Rome" }
// ]
Performs a full outer join by pairing elements from both iterables for every distinct key.
Curried version of _fullOuterJoin.