Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Switch to "true" dependency injection #18

Open
JoshuaKGoldberg opened this issue Nov 27, 2017 · 0 comments
Open

Switch to "true" dependency injection #18

JoshuaKGoldberg opened this issue Nov 27, 2017 · 0 comments

Comments

@JoshuaKGoldberg
Copy link
Member

Right now, stores typically have the following kind of logic:

// ContainerStore.ts
import { ChildStore, IChildStoreDependencies } from "./ChildStore";

export interface IContainerStoreDependencies extends IChildStoreDependencies { /* .. */ }

export class ContainerStore {
    public readonly child = new ChildStore(this.dependencies);
}

This means a lot of stores have really big dependencies typings. It would be more true to the DI way if the child stores were passed into the parents.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant