
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
@ecl/ec-auto-init
Advanced tools
In order to automatically initialize a component, add data-ecl-auto-init="[component class]"
to the root element of the component.
For example, if you want to auto initialize a Message
:
<div
role="alert"
class="ecl-message ecl-message--info"
data-ecl-message="true"
data-ecl-auto-init="Message"
>
... Message component ...
</div>
Then, in the footer of the document (or whenever the document is ready), call:
ECL.autoInit();
ECL.autoInit()
returns an object containing:
<div
role="alert"
class="ecl-message ecl-message--info"
data-ecl-message="true"
data-ecl-auto-init="Message"
data-ecl-auto-initialized="true"
>
... Message component ...
</div>
Once ECL.autoInit()
is called, you can access the component instance via an ECLMessage
property on that element.
document.querySelector('[data-ecl-message]').ECLMessage.handleClickOnClose();
Please note that the first iteration of ECL.autoInit()
was returning only a list of initialized components and you had to call destroy()
method of each component individually.
class MyComponent extends React.Component {
constructor(props) {
super(props);
- this.components = null;
+ this.autoinit = null;
}
componentDidMount() {
if (!window.ECL) return;
- this.components = window.ECL.autoInit();
+ this.autoinit = window.ECL.autoInit();
}
componentDidUpdate() {
if (!window.ECL) return;
-
- if (this.components) {
- this.components.forEach(c => c.destroy());
- }
-
- this.components = window.ECL.autoInit();
+ this.autoinit.update();
}
componentWillUnmount() {
if (!window.ECL) return;
-
- if (this.components) {
- this.components.forEach(c => c.destroy());
- }
+ this.autoinit.destroy();
}
render() {}
FAQs
ECL Auto Init
The npm package @ecl/ec-auto-init receives a total of 0 weekly downloads. As such, @ecl/ec-auto-init popularity was classified as not popular.
We found that @ecl/ec-auto-init demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.