# @rebelcode/vc-toggleable

> Toggleable component

Latest version **0.1.0** (published 2018-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rebelcode/vc-toggleable
pnpm add @rebelcode/vc-toggleable
yarn add @rebelcode/vc-toggleable
bun add @rebelcode/vc-toggleable
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-02-07 |
| First published | 2018-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 177.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | RebelCode |
| Maintainers | romalytvynenko, xedinunknown |

## Links

- npm: https://www.npmjs.com/package/@rebelcode/vc-toggleable
- npm.io page: https://npm.io/package/@rebelcode/vc-toggleable

## Recent versions

- 0.1.0 (latest) — 2018-02-07
- 0.1.4 (alpha-5) — 2018-02-08
- 0.1.3 (alpha-3) — 2018-02-08
- 0.1.2 (alpha-2) — 2018-02-07
- 0.1.1 — 2018-02-07

## README

# Toggleable Component
[![npm (scoped)](https://img.shields.io/npm/v/@rebelcode/vc-toggleable.svg)]()

## Usage
```js
<toggle :toggleable="toggleable" inline-template>
    <span @click="setState(!isOn)">
        {{ isOn ? 'On' : 'Off' }}
    </span>
</toggle>
```
Toggleable component implements logic responsible for getting Toggle model state and setting it. So consumer needs to use `inline-template`. Inside that template next functions and variables available: 

`setState({boolean} newState)` - set toggle model state

`isOn` - is toggle model state set to `true`

Also, `toggleable` property receives object, instance of [FunctionalToggleable](https://github.com/RebelCode/std-lib/blob/task/functional-toggleable/src/FunctionalToggleable.js)

## Developing
Run `npm install` to install all dev dependencies.

Here is available npm commands.

Build library while developing
```sh
npm run dev
```

Build library for production
```sh
npm run production
```

Run e2e tests
```sh
npm run e2e
```

---
_Source: https://npm.io/package/@rebelcode/vc-toggleable · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
