Skip to content

feat(context): Improve bindings with options, resolution tracking, and error propagation - #671

Closed
raymondfeng wants to merge 2 commits into
masterfrom
add-binding-options
Closed

feat(context): Improve bindings with options, resolution tracking, and error propagation#671
raymondfeng wants to merge 2 commits into
masterfrom
add-binding-options

Conversation

@raymondfeng

@raymondfeng raymondfeng commented Oct 20, 2017

Copy link
Copy Markdown
Contributor

Description

The PR adds the following features:

  1. Allow options to be provided for a binding

    • Add options property and withOptions method for a binding
    • Add @injection.options to receive injection of options
    • Fix routing table to use dependency injection
  2. Introduce ResolutionSession to track dependency resolution chain

    • Pass binding to dependency resolution
    • Track a stack of bindings to provide resolution path and detect circular dependencies
  3. Improve the error handling to propagate errors gracefully through the promise/async/await chain

    • Introduce RejectionError
    • Add utilities to handle RejectionError for values or promises injection

Related issues

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants