@@ -14,7 +14,7 @@ export class Components implements Disposable {
1414 /**
1515 * The version of the @thatopen/components library.
1616 */
17- static readonly release = "2.2.11 " ;
17+ static readonly release = "2.2.12 " ;
1818
1919 /** {@link Disposable.onDisposed } */
2020 readonly onDisposed = new Event < void > ( ) ;
@@ -33,6 +33,26 @@ export class Components implements Disposable {
3333
3434 private _clock : THREE . Clock ;
3535
36+ /**
37+ * Event that triggers the Components instance is initialized.
38+ *
39+ * @remarks
40+ * This event is triggered once when the {@link Components.init} method has been called and finish processing.
41+ * This is useful to set configuration placeholders that need to be executed when the components instance is initialized.
42+ * For example, enabling and configuring custom effects in a post-production renderer.
43+ *
44+ * @example
45+ * ```typescript
46+ * const components = new Components();
47+ * components.onInit.add(() => {
48+ * // Enable custom effects in the post-production renderer
49+ * // or any other operation dependant on the component initialization
50+ * });
51+ * components.init();
52+ * ```
53+ */
54+ readonly onInit = new Event < undefined > ( ) ;
55+
3656 /**
3757 * Adds a component to the list of components.
3858 * Throws an error if a component with the same UUID already exists.
@@ -88,13 +108,12 @@ export class Components implements Disposable {
88108 * Initializes the Components instance.
89109 * This method starts the animation loop, sets the enabled flag to true,
90110 * and calls the update method.
91- *
92- * @returns {void }
93111 */
94112 init ( ) {
95113 this . enabled = true ;
96114 this . _clock . start ( ) ;
97115 this . update ( ) ;
116+ this . onInit . trigger ( ) ;
98117 }
99118
100119 /**
0 commit comments