# tower-collection

> Arrays that automatically update your UI.

Latest version **0.1.0** (published 2013-06-24) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2013-06-24 |
| First published | 2013-06-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | viatropos |

## Links

- npm: https://www.npmjs.com/package/tower-collection
- Repository: http://github.com/tower/collection
- npm.io page: https://npm.io/package/tower-collection

## Dependencies (3)

- [indexof](https://npm.io/package/indexof.md) *
- [part-is-array](https://npm.io/package/part-is-array.md) *
- [tower-emitter](https://npm.io/package/tower-emitter.md) ~0.1.0

## Recent versions

- 0.1.0 (latest) — 2013-06-24
- 0.1.0pre2 — 2013-06-18
- 0.1.0pre — 2013-06-02

## README

# Tower Collection

Arrays that automatically update your UI.

## Installation

```bash
$ component install tower/collection
```

## Example

```js
var collection = require('tower-collection');
```

Create a blank collection:

```js
collection(); // []
collection([]); // []
```

## API

### push

```js
collection.push(item);
collection.push(item1, item2);
```

### pop

```js
collection.pop();
```

### shift

Remove first item in array.

```js
collection.shift();
```

### unshift

Add item(s) to beginning of array.

```js
collection.unshift(item);
collection.unshift(item1, item2);
```

### splice(index, length, item)

Modify the original array.

```js
collection.splice(1, 2, item);
```

### length

```js
collection.length;
```

## Notes

The `collection` is only necessary to bind lists of data (such as queries) to the DOM. It just makes it easier to listen for changes to an array. In most other cases you can just use plain arrays and don't need the power of dirty tracking.

## Licence

MIT

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