Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove hard dependency of DI on FASTElement #6280

Merged
merged 7 commits into from
Aug 16, 2022
Next Next commit
refactor: remove dependency of DI on FASTElement
  • Loading branch information
EisenbergEffect committed Aug 15, 2022
commit db7ece6d4d0896cf39b3472cf5f00e1a47e18821
5 changes: 2 additions & 3 deletions packages/web-components/fast-element/src/di/di.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Big thanks to https://github.com/fkleuver and the https://github.com/aurelia/aurelia project
* for the bulk of this code and many of the associated tests.
*/
import { FASTElement } from "../components/fast-element.js";
import { Context, ContextDecorator, ContextEvent, UnknownContext } from "../context.js";
import { Class, Constructable, Message } from "../interfaces.js";
import { Metadata } from "../metadata.js";
Expand Down Expand Up @@ -777,8 +776,8 @@ export const DI = Object.freeze({
value = container.get(key);
this[diPropertyKey] = value;

if (respectConnection && this instanceof FASTElement) {
const notifier = (this as FASTElement).$fastController;
if (respectConnection) {
const notifier = (this as any).$fastController;
const handleChange = () => {
const newContainer = DI.findResponsibleContainer(this);
const newValue = newContainer.get(key) as any;
Expand Down