Provider

Provider

new Provider()

Source:

Methods

aliasTo(key)

Define provider by an alias to another depedency.

Source:
Parameters:
Name Type Description
key string

The key of another dependency.

Example
context.provide('logger').aliasTo('println');

as(value, options)

Define provider by a just simple value.

Source:
Parameters:
Name Type Description
value *

The value.

options Object

The options. (For the future use)

Example
context.provide('logger').as(console.log);

with(getter, options)

Define provider by a getter function. The provider will provide a value returned by the function.

Source:
Parameters:
Name Type Description
getter function

The getter function.

options Object

The options. (For the future use)

Example
context.provide('logger').with(() => {
  return console.log;
});