diff --git a/src/core/reactor.ts b/src/core/reactor.ts index b20f30e55..765b9117b 100644 --- a/src/core/reactor.ts +++ b/src/core/reactor.ts @@ -503,6 +503,20 @@ export abstract class Reactor extends Component { public delete(reactor: Reactor): void { reactor._delete(); } + + public addChild( + constructor: new (container: Reactor, ...args: G) => R, + ...args: G + ): R { + return this.reactor._addChild(constructor, ...args); + } + + public addSibling( + constructor: new (container: Reactor, ...args: G) => R, + ...args: G + ): R { + return this.reactor._addSibling(constructor, ...args); + } }; /** @@ -1639,10 +1653,7 @@ export abstract class Reactor extends Component { `Reactor ${this} is self-contained. Adding sibling creates logical issue.` ); } - const newReactor = this._getContainer()._addChild( - constructor, - ...args - ); + const newReactor = this._getContainer()._addChild(constructor, ...args); this._creatorKeyChain.set(newReactor, newReactor._key); return newReactor; } @@ -1889,6 +1900,16 @@ export interface MutationSandbox extends ReactionSandbox { getReactor: () => Reactor; // Container + addChild: ( + constructor: new (container: Reactor, ...args: G) => R, + ...args: G + ) => R; + + addSibling: ( + constructor: new (container: Reactor, ...args: G) => R, + ...args: G + ) => R; + // FIXME: // forkJoin(constructor: new () => Reactor, ): void; }