@@ -27,7 +27,7 @@ export class Microframework {
2727 * Stores all settings of modules bootstrapped by microframework.
2828 * If its undefined it means framework is not bootstrapped yet.
2929 */
30- private settings ?: MicroframeworkSettings ;
30+ private frameworkSettings ?: MicroframeworkSettings ;
3131
3232 // -------------------------------------------------------------------------
3333 // Public Methods
@@ -103,15 +103,26 @@ export class Microframework {
103103 * Shutdowns all modules.
104104 */
105105 shutdown ( ) : Promise < this> {
106- if ( ! this . settings )
106+ if ( ! this . frameworkSettings )
107107 throw new MicroframeworkNotBootstrappedError ( ) ;
108108
109- return this . runInSequence ( this . settings . getShutdownHandlers ( ) , handler => {
109+ return this . runInSequence ( this . frameworkSettings . getShutdownHandlers ( ) , handler => {
110110 const handlerResult = handler ( ) ;
111111 return handlerResult instanceof Promise ? handlerResult : Promise . resolve ( ) ;
112112 } ) . then ( ( ) => this ) ;
113113 }
114114
115+ /**
116+ * Returns microframework settings used and modified by bootstrapped modules.
117+ * If framework was not bootstrapped yet, this accessor will throw an error.
118+ */
119+ get settings ( ) : MicroframeworkSettings {
120+ if ( ! this . frameworkSettings )
121+ throw new MicroframeworkNotBootstrappedError ( ) ;
122+
123+ return this . frameworkSettings ;
124+ }
125+
115126 // -------------------------------------------------------------------------
116127 // Private Methods
117128 // -------------------------------------------------------------------------
0 commit comments