diff --git a/core/src/core-api/config.js b/core/src/core-api/config.js index 3c1d192afd..024327da15 100644 --- a/core/src/core-api/config.js +++ b/core/src/core-api/config.js @@ -266,6 +266,19 @@ class LuigiConfig { } this.configChanged(); } + + /** + * Reset the current Luigi instance and initialize Luigi with the latest Luigi config. + * @memberof Configuration + * @example + * Luigi.reset(); + * @since NEXTRELEASE + */ + reset () { + const cfg = this.getConfig(); + this.unload(); + this.setConfig(cfg); + } } export const config = new LuigiConfig(); diff --git a/docs/luigi-core-api.md b/docs/luigi-core-api.md index 2915fc0d5f..b036451f2a 100644 --- a/docs/luigi-core-api.md +++ b/docs/luigi-core-api.md @@ -213,6 +213,20 @@ Returns **[promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/ - **since**: 1.7.1 +#### reset + +Reset the current Luigi instance and initialize Luigi with the latest Luigi config. + +##### Examples + +```javascript +Luigi.reset(); +``` + +**Meta** + +- **since**: NEXTRELEASE + ## Luigi.elements()