Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset luigi via core api #2092

Merged
merged 6 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions core/src/core-api/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
14 changes: 14 additions & 0 deletions docs/luigi-core-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
Expand Down