Skip to content

Commit

Permalink
DomComponent does not merge own available output with childs selected
Browse files Browse the repository at this point in the history
  • Loading branch information
paldepind committed Aug 20, 2019
1 parent 41a92fe commit 4bf9458
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/dom-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export function handleProps<A>(props: InitialProperties, elm: HTMLElement): A {
return output;
}

class DomComponent<O, P, A> extends Component<A & P, O & P> {
class DomComponent<O, P, A> extends Component<A, O & P> {
constructor(
private tagName: string,
private props: InitialProperties,
Expand All @@ -353,7 +353,6 @@ class DomComponent<O, P, A> extends Component<A & P, O & P> {
if (this.child !== undefined) {
const childResult = this.child.run(elm, destroyed.mapTo(false));
Object.assign(output, childResult.output);
Object.assign(available, childResult.output);
}
destroyed.subscribe((toplevel) => {
if (toplevel) {
Expand All @@ -376,10 +375,7 @@ export type Wrapped<P, O> = (undefined extends P
// Only props
(props?: P): Component<O, {}>;
// Only child
<Ch extends Child>(child: Ch): Component<
ChildSelectedOutput<Ch> & O,
ChildSelectedOutput<Ch>
>;
<Ch extends Child>(child: Ch): Component<O, ChildSelectedOutput<Ch>>;
}
: {
// Required props
Expand All @@ -388,7 +384,7 @@ export type Wrapped<P, O> = (undefined extends P
}) & {
// Both props and child
<Ch extends Child>(props: P, child: Ch): Component<
ChildSelectedOutput<Ch> & O,
O,
ChildSelectedOutput<Ch>
>;
};
Expand Down

0 comments on commit 4bf9458

Please sign in to comment.