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

Get a list of Ember apps on the page #1

Open
chancancode opened this issue Jul 9, 2020 · 2 comments
Open

Get a list of Ember apps on the page #1

chancancode opened this issue Jul 9, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@chancancode
Copy link
Member

$edb.getApps() => [...]
@chancancode chancancode added the enhancement New feature or request label Jul 9, 2020
@buschtoens
Copy link
Collaborator

Interesting point. It did not even occur to me, that there may be multiple apps running on the same page.

How are other app-instance-specific helpers supposed to behave, when there's multiple app instances?

I'd say in the majority of cases, there's only one app instance per page, so it'd be great if the helper would then default to using that app instance. Or maybe you can set a default context instead of explicitly passing the app in the helper.

@chancancode
Copy link
Member Author

chancancode commented Jul 9, 2020

What if we make these things return AppDebug?

interface EmberDebug {
  getApps(): AppDebug[];
  getAppByName(name: string): AppDebug | null;
}

interface AppDebug {
  name: string;
  app: Ember.Application;
  instance: Ember.ApplicationInstance;
  lookup(key: string): unknown;
  renderTree: RenderTreeDebug;
}

...

So you can do $edb.getAppByName('my-app').lookup('store:main'), etc. I suppose we can have a getMainApp() too, but what does the "main" app really mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants