-
Notifications
You must be signed in to change notification settings - Fork 4
Dependencies
Manfred Kaul edited this page Jan 27, 2019
·
4 revisions
There are 2 types of resource dependencies:
- dynamic (at run-time)
- semi-dynamic (at run-time, but only at start-up time)
So far, there is no static dependency management. All resource dependencies are managed at run-time.
Semi-dynamic dependencies should be preferred, because they are solved at start-up time in the init phase of the component life-cycle.
const result = await ccm.start( "path/to/ccm.sub_component.js", individual_config );
There are two types of semi-dynamic dependencies:
Declare a component dependency inside the config of a master component as follows:
config: {
sub_component: [ "ccm.component", "path/to/ccm.sub_component.js" ]
...
}
// start sub component with individual config
start: async () => {
const instance = await this.sub_component.instance( individual_config );
const result = await instance.start();
}
Declare a instance dependency inside the config of a master component as follows:
config: {
sub_component: [ "ccm.instance", "path/to/ccm.sub_component.js", "individual config" ]
...
}
start: async () => {
const result = await this.sub_component.start();
}