How to use the carbon-components/es/globals/js/misc/mixin function in carbon-components

To help you get started, we’ve selected a few carbon-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github carbon-design-system / carbon-website / src / components / ComponentExample / inline-loading-demo-button.js View on Github external
import mixin from 'carbon-components/es/globals/js/misc/mixin';
import createComponent from 'carbon-components/es/globals/js/mixins/create-component';
import initComponentBySearch from 'carbon-components/es/globals/js/mixins/init-component-by-search';
import handles from 'carbon-components/es/globals/js/mixins/handles';
import on from 'carbon-components/es/globals/js/misc/on';
import InlineLoading from 'carbon-components/es/components/inline-loading/inline-loading';

class InlineLoadingDemoButton extends mixin(
  createComponent,
  initComponentBySearch,
  handles
) {
  /**
   * The button for inline loading demo.
   * @extends CreateComponent
   * @extends InitComponentBySearch
   * @extends Handles
   * @param {HTMLElement} element The element working as the button for inline loading demo.
   */
  constructor(element) {
    super(element);
    this.manage(
      on(element, 'click', event => {
        this.toggle(event);