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

Bundle Bootstrapping #28

Closed
ecowden opened this issue Jan 29, 2017 · 1 comment
Closed

Bundle Bootstrapping #28

ecowden opened this issue Jan 29, 2017 · 1 comment
Assignees
Milestone

Comments

@ecowden
Copy link
Owner

ecowden commented Jan 29, 2017

After we have asynchronous injection (#25), the old .eagerlyLoadAll(...) doesn't make as much sense. Instead, this is our opportunity to "bootstrap" the whole shebang (probably the whole application). It should try to load all injectables, resolve all promises as needed, and return an object holding the fully bootstrapped set of components.

  const anInstance = Promise.resolve({}) // Promises will be resolved
  const bind = pluto()
  bind('myInstance').toInstance(anInstance)

  // ... eagerly load everything. Maybe `.bootstrap()`?
  const app = yield bind.eagerlyLoadAll()

  // ...and then everything can be retrieved synchronously
  t.is(app.get('myInstance'), anInstance)
@ecowden ecowden added this to the v1.0 milestone Jan 29, 2017
@ecowden ecowden self-assigned this Jan 29, 2017
@ecowden
Copy link
Owner Author

ecowden commented Jan 29, 2017

Fixed on one-oh-redesign branch.

@ecowden ecowden closed this as completed Jan 29, 2017
@ecowden ecowden mentioned this issue Jan 29, 2017
ecowden added a commit that referenced this issue Feb 4, 2017
Fixes #15, fixes #25, fixes #26, fixes #27, fixes #28, fixes #29.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant