# @advanced-rest-client/variables-consumer-mixin

> Mixin to be used by elements that consumes variables

Latest version **3.0.6** (published 2020-03-16) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @advanced-rest-client/variables-consumer-mixin
pnpm add @advanced-rest-client/variables-consumer-mixin
yarn add @advanced-rest-client/variables-consumer-mixin
bun add @advanced-rest-client/variables-consumer-mixin
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.0.6 |
| Published | 2020-03-16 |
| First published | 2019-03-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | jarrodek |
| Keywords | advanced-rest-client, variables, mixin |

## Links

- npm: https://www.npmjs.com/package/@advanced-rest-client/variables-consumer-mixin
- Repository: https://github.com/advanced-rest-client/variables-consumer-mixin
- Homepage: https://github.com/advanced-rest-client/variables-consumer-mixin#readme
- Issues: https://github.com/advanced-rest-client/variables-consumer-mixin/issues
- npm.io page: https://npm.io/package/@advanced-rest-client/variables-consumer-mixin

## Recent versions

- 3.0.6 (latest) — 2020-03-16
- 3.0.5 — 2019-10-04
- 3.0.4 — 2019-09-26
- 3.0.3 — 2019-09-12
- 3.0.2 — 2019-08-02
- 3.0.1 — 2019-08-02
- 3.0.0 — 2019-08-02
- 2.0.0 — 2019-08-02
- 3.0.0-preview.1 — 2019-03-28

## README

[![Published on NPM](https://img.shields.io/npm/v/@advanced-rest-client/variables-consumer-mixin.svg)](https://www.npmjs.com/package/@advanced-rest-client/variables-consumer-mixin)

[![Build Status](https://travis-ci.org/advanced-rest-client/variables-consumer-mixin.svg?branch=stage)](https://travis-ci.org/advanced-rest-client/variables-consumer-mixin)

[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/advanced-rest-client/variables-consumer-mixin)

# variables-consumer-mixin

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.

## Usage

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

### In a LitElement template

```javascript
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);
```

### Development

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

### Running the tests

```sh
npm test
```

---
_Source: https://npm.io/package/@advanced-rest-client/variables-consumer-mixin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
