Mixin to be used by elements that consumes variables

Usage no npm install needed!

<script type="module">
  import advancedRestClientVariablesConsumerMixin from 'https://cdn.skypack.dev/@advanced-rest-client/variables-consumer-mixin';


Published on NPM

Build Status

Published on webcomponents.org


A mixin function to be used by elements that consumes Advanced REST Client variables.

The mixin works with:

  • @advanced-rest-client/arc-models/variables-model.js (or compatible events API)
  • @advanced-rest-client/variables-manager (or compatible events API)

By default the component using the mixin queries for current environment (the manager) and then for variables list in the environment (data model). If this operation fails (for example model or manager is still being initialized) then it listens for manager events to refresh its state.



npm install --save @advanced-rest-client/variables-consumer-mixin

In a LitElement template

import { LitElement, html } from 'lit-element';
import { VariablesConsumerMixin } from '@advanced-rest-client/variables-consumer-mixin/variables-consumer-mixin.js';

class SampleElement extends VariablesConsumerMixin(LitElement) {
customElements.define('sample-element', SampleElement);


git clone https://github.com/advanced-rest-client/variables-consumer-mixin
cd variables-consumer-mixin
npm install

Running the tests

npm test