ES module compatibility
Easy Toggle State is a library that was thought from the beginning to be used in a quick and easy way.
Responding to the requests, it now can be used in ESM projects. 🎉
Initializing, unbinding a trigger, unbinding all triggers and getting the state of a trigger are now exposed and ready to be used by yourself:
import initialize, { isActive, unbind, unbindAll } from "easy-toggle-state";
const handler = () => {
initialize();
document.removeEventListener("DOMContentLoaded", handler);
};
document.addEventListener("DOMContentLoaded", handler);
window.easyToggleState = Object.assign(
initialize,
{
isActive,
unbind,
unbindAll
}
);
Learn more in the new API section in the documentation.
Happy toggling 🖖