# yo-yo-collection

> Keep a collection of yo-yo components and handle state

Latest version **1.0.1** (published 2017-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install yo-yo-collection
pnpm add yo-yo-collection
yarn add yo-yo-collection
bun add yo-yo-collection
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-05-15 |
| First published | 2017-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jens Lind |
| Maintainers | jenslind |
| Keywords | yo-yo |

## Links

- npm: https://www.npmjs.com/package/yo-yo-collection
- Repository: https://github.com/jenslind/yo-yo-collection
- Homepage: https://github.com/jenslind/yo-yo-collection#readme
- Issues: https://github.com/jenslind/yo-yo-collection/issues
- npm.io page: https://npm.io/package/yo-yo-collection

## Dependencies (2)

- [yo-yo](https://npm.io/package/yo-yo.md) ^1.4.0
- [nanobus](https://npm.io/package/nanobus.md) ^3.2.1

## Recent versions

- 1.0.1 (latest) — 2017-05-15
- 1.0.0 — 2017-05-13

## README

# yo-yo-collection
> Keep a collection of [`yo-yo`](https://github.com/maxogden/yo-yo) components.

## Install
```
npm install yo-yo-collection
```

## Why
Needed a way to handle state and update of multiple small `yo-yo` components. Inspired by [choo](https://github.com/yoshuawuyts/choo).

## Example
```javascript
const collection = new Collection()

// Add a component to the collection
collection.component(function (state, bus) {
  return yo`<div>${state.data}</div>`
})

// Add a store
collection.store(function (state, bus) {
  bus.on('data', function (data) {
    state.data = data
    bus.emit('rerender')
  })
})
```

## License
MIT

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