# callbag-from-event-pattern

> 👜 Callbag source factory from addHandler and removeHandler pair.

Latest version **1.0.0** (published 2018-04-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install callbag-from-event-pattern
pnpm add callbag-from-event-pattern
yarn add callbag-from-event-pattern
bun add callbag-from-event-pattern
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-04-26 |
| First published | 2018-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mateusz Burzyński |
| Maintainers | andarist |
| Keywords | callbag, callbags, sample |

## Links

- npm: https://www.npmjs.com/package/callbag-from-event-pattern
- Repository: https://github.com/Andarist/callbag-from-event-pattern
- Homepage: https://github.com/Andarist/callbag-from-event-pattern#readme
- Issues: https://github.com/Andarist/callbag-from-event-pattern/issues
- npm.io page: https://npm.io/package/callbag-from-event-pattern

## Dependencies (1)

- [callbag-create](https://npm.io/package/callbag-create.md) ^1.1.1

## Recent versions

- 1.0.0 (latest) — 2018-04-26
- 0.0.0 — 2018-04-19

## README

# callbag-from-event-pattern

Callbag source factory from `addHandler` and `removeHandler` pair.

## Example

```js
import forEach from 'callbag-for-each'
import fromEventPattern from 'callbag-from-event-pattern'
import map from 'callbag-map'
import pipe from 'callbag-pipe'

const addHandler = handler => {
  document.addEventListener('click', handler)
}

const removeHandler = handler => {
  document.removeEventListener('click', handler)
}

pipe(
  fromEventPattern(addHandler, removeHandler),
  map(({ clientX: x, clientY: y }) => ({ x, y })),
  forEach(coord => {
    // will log coordinate of each click
    console.log(coord)
  }),
)
```

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