Page Contents

Home > @loopback/context > ResolutionSession

ResolutionSession class

Object to keep states for a session to resolve bindings and their dependencies within a context

Signature:

export declare class ResolutionSession 

Properties

Property Modifiers Type Description
[bindingStack](/doc/en/lb4/apidocs.context.resolutionsession.bindingstack.html) `readonly` Readonly<[Binding](/doc/en/lb4/apidocs.context.binding.html)>\[\] Getter for bindings on the stack
[currentBinding](/doc/en/lb4/apidocs.context.resolutionsession.currentbinding.html) `readonly` Readonly<[Binding](/doc/en/lb4/apidocs.context.binding.html)> \| undefined Getter for the current binding
[currentInjection](/doc/en/lb4/apidocs.context.resolutionsession.currentinjection.html) `readonly` Readonly<[Injection](/doc/en/lb4/apidocs.context.injection.html)> \| undefined Getter for the current injection
[injectionStack](/doc/en/lb4/apidocs.context.resolutionsession.injectionstack.html) `readonly` Readonly<[Injection](/doc/en/lb4/apidocs.context.injection.html)>\[\] Getter for injections on the stack
[stack](/doc/en/lb4/apidocs.context.resolutionsession.stack.html) `readonly` [ResolutionElement](/doc/en/lb4/apidocs.context.resolutionelement.html)\[\] A stack of bindings for the current resolution session. It's used to track the path of dependency resolution and detect circular dependencies.

Methods

Method Modifiers Description
[describeInjection(injection)](/doc/en/lb4/apidocs.context.resolutionsession.describeinjection.html) `static` Describe the injection for debugging purpose
[fork(session)](/doc/en/lb4/apidocs.context.resolutionsession.fork.html) `static` Fork the current session so that a new one with the same stack can be used in parallel or future resolutions, such as multiple method arguments, multiple properties, or a getter function
[getBindingPath()](/doc/en/lb4/apidocs.context.resolutionsession.getbindingpath.html) Get the binding path as `bindingA --> bindingB --> bindingC`.
[getInjectionPath()](/doc/en/lb4/apidocs.context.resolutionsession.getinjectionpath.html) Get the injection path as `injectionA --> injectionB --> injectionC`.
[getResolutionPath()](/doc/en/lb4/apidocs.context.resolutionsession.getresolutionpath.html) Get the resolution path including bindings and injections, for example: `bindingA --> @ClassA[0] --> bindingB --> @ClassB.prototype.prop1 --> bindingC`.
[popBinding()](/doc/en/lb4/apidocs.context.resolutionsession.popbinding.html) Exit the resolution of a binding
[popInjection()](/doc/en/lb4/apidocs.context.resolutionsession.popinjection.html) Pop the last injection
[pushBinding(binding)](/doc/en/lb4/apidocs.context.resolutionsession.pushbinding.html) Enter the resolution of the given binding. If
[pushInjection(injection)](/doc/en/lb4/apidocs.context.resolutionsession.pushinjection.html) Push the injection onto the session
[runWithBinding(action, binding, session)](/doc/en/lb4/apidocs.context.resolutionsession.runwithbinding.html) `static` Run the given action with the given binding and session
[runWithInjection(action, injection, session)](/doc/en/lb4/apidocs.context.resolutionsession.runwithinjection.html) `static` Run the given action with the given injection and session
[toString()](/doc/en/lb4/apidocs.context.resolutionsession.tostring.html)