# observable-linked-list

> observe a linked list of objects

Latest version **1.0.0** (published 2018-04-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install observable-linked-list
pnpm add observable-linked-list
yarn add observable-linked-list
bun add observable-linked-list
```

## 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.0 |
| Published | 2018-04-20 |
| First published | 2018-04-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jan Bölsche |
| Maintainers | regular |
| Keywords | observable, list |

## Links

- npm: https://www.npmjs.com/package/observable-linked-list
- npm.io page: https://npm.io/package/observable-linked-list

## Recent versions

- 1.0.0 (latest) — 2018-04-20

## README

# observable-linked-list

Observable for a linked list. Subscribe to changes of any part of the chain of linked objects.

## API

`observable = oll(root, link, getObs)`

- `root` - the root of the chain, an observable
- `link` - function that extracts a link from an object. Links should be comparable with `==` (strings, numbers ...)
- `getObs` - called with result of `link()`, must return observable for the linked object.

## Example

``` js
const oll = require('observable-linked-list')
const Value = require('mutant/value')

const obs = {
  a: Value({link: 'b'}),
  b: Value('foo'),
  c: Value('baz')
}

const listObs = oll(obs.a, x => x.link, x => obs[x])
console.log(listObs()) // --> [ { link: 'b' }, 'foo' ]

listObs( list => {
  console.log(list)
})

obs.b.set('bar') // --> [ { link: 'b' }, 'bar' ]
obs.a.set({link: 'c'}) // --> [ { link: 'c' }, 'baz' ]
obs.c.set({link: 'b'}) // --> [ { link: 'c' }, { link: 'b' }, 'bar' ]
```

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