# @rebelcode/vc-repeater

> Repeater component

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

## Install

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

## 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-08 |
| First published | 2018-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | RebelCode |
| Maintainers | romalytvynenko, xedinunknown |

## Links

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

## Recent versions

- 0.1.0 (latest) — 2018-02-08

## README

# Repeater Component

## Usage
```js
<repeater :collection="items">
    <div class="repeater-item" slot-scope="r">
        <span>{{ r.item.title }}</span>
        <button @click="r.remove(r.item)">x</button>
    </div>
</repeater>
```
Where `collection` has type of `FunctionalCollection` from [std-lib](https://github.com/RebelCode/std-lib).

This example will iterate through all items in `collection` object and output each item using child `repeater` code (`<div slot-scope="r"...` in our case). Next options is available in item's code:

> `{scopeName}` is string you've passed to `slot-scope` attribute inside item's template. In our example is `r`. In that template you'll be able to access to exposed methods and variables using that scope.

`{scopeName}.remove(item)` - function for removing item from the collection. Usefull when you want to add controls to your items (like `x` button for removing).

`{scopeName}.item` - item that we iterating on from our collection.

## 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-repeater · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
