@catalyst-elements/catalyst-lazy-properties-mixin

A mixin that allows for lazy properties on an element.

Usage no npm install needed!

<script type="module">
  import catalystElementsCatalystLazyPropertiesMixin from 'https://cdn.skypack.dev/@catalyst-elements/catalyst-lazy-properties-mixin';
</script>

README

catalyst-lazy-properties-mixin

Travis David David npm (scoped) Bower not supported Polymer 2 not supported Polymer 3 support pending

API documentation ↗

<catalyst-lazy-properties-mixin> is a mixin that provides an element with toggle behavior.

Installation

Install with npm:

npm install --save @catalyst-elements/catalyst-lazy-properties-mixin

Install with yarn:

yarn add @catalyst-elements/catalyst-lazy-properties-mixin

Please note that this package is not compatible with Bower.

Usage

As a Module (Recommend)

import catalystLazyPropertiesMixin from './node_modules/@catalyst-elements/catalyst-lazy-properties-mixin/catalyst-lazy-properties-mixin.js';

class MyLazyPropertiesElement extends catalystLazyPropertiesMixin(HTMLElement) {
  constructor() {
    super();
    // ...
  }

  // ...
}

As a Script

<script src="node_modules/@catalyst-elements/catalyst-lazy-properties-mixin/catalyst-lazy-properties-mixin.es5.min.js"></script>
<script>
  var SuperClass = window.CatalystElements.catalystLazyPropertiesMixin(HTMLElement);

  function MyLazyPropertiesElement() {
    SuperClass.call(this);
    // ...
  };
  MyLazyPropertiesElement.prototype = Object.create(SuperClass.prototype);
  MyLazyPropertiesElement.prototype.constructor = MyLazyPropertiesElement;

  // ...
</script>

Please note that this script has been transpiled to es5 and thus use of custom-elements-es5-adapter.js or an equivalent library is required. See es5 support on the Catalyst Elements wiki for details.

Contributions

Contributions are most welcome.

Please read our contribution guidelines.