# weak-bubble

> Bubble weakmap-events up without explicit re-broadcasting

Latest version **2.1.0** (published 2016-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install weak-bubble
pnpm add weak-bubble
yarn add weak-bubble
bun add weak-bubble
```

## 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 | 2.1.0 |
| Published | 2016-07-07 |
| First published | 2015-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | broadcast, bubble, events, weakmap |

## Links

- npm: https://www.npmjs.com/package/weak-bubble
- Repository: https://github.com/bendrucker/weak-bubble
- Homepage: https://github.com/bendrucker/weak-bubble#readme
- Issues: https://github.com/bendrucker/weak-bubble/issues
- npm.io page: https://npm.io/package/weak-bubble

## Dependencies (2)

- [xtend](https://npm.io/package/xtend.md) ~4.0.1
- [map-values](https://npm.io/package/map-values.md) ~1.0.1

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2016-07-07
- 2.0.0 — 2016-03-03
- 1.1.0 — 2015-08-11
- 1.0.1 — 2015-08-07
- 1.0.0 — 2015-08-04

## README

# weak-bubble [![Build Status](https://travis-ci.org/bendrucker/weak-bubble.svg?branch=master)](https://travis-ci.org/bendrucker/weak-bubble)

> Bubble weakmap-events up without explicit re-broadcasting


## Install

```
$ npm install --save weak-bubble
```


## Usage

```js
var event = require('weakmap-event')()
var bubble = require('weak-bubble')
var state = {
  foo: {}
}

var listen = bubble({foo: event.listen})
listen(state, function (data) {
  //=> 'DATA!'
})
event.broadcast(state.foo, 'DATA!')
```

## API

#### `bubble(listeners, [transform])` -> `function`

##### listeners

*Required*  
Type: `object`

An object where the keys represent keys in your object and the values are the listen functions from a [weakmap-event](https://github.com/eaze/weakmap-event).

##### transform

Type: `function`  
Arguments: `state, data`

An optional function called with the state and event data. By default, the event data is forwarded up. By passing in a function, you can add or remove properties or return entirely different data.

If you return `false`, the listeners will not be called.


## License

MIT © [Ben Drucker](http://bendrucker.me)

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