Skip to content

Commit

Permalink
featI(di): enhance defer to fallback reasonably if no handler found
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Aug 22, 2019
1 parent 271ce6d commit 3edb9ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/kernel/src/di.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,12 @@ export class ParameterizedRegistry implements IRegistry {
) {}

public register(container: IContainer): void {
const registry = container.get<IRegistry>(this.key);
registry.register(container, ...this.params);
if (container.has(this.key, true)) {
const registry = container.get<IRegistry>(this.key);
registry.register(container, ...this.params);
} else {
this.params.forEach(x => container.register(x));
}
}
}

Expand Down

0 comments on commit 3edb9ec

Please sign in to comment.