2.0.1 • Published 8 months ago

erre.fromdom v2.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 months ago

erre.fromDOM

erre erre plugin to stream DOM events

Build Status

NPM version NPM downloads MIT License

Installation

npm i erre.fromdom -S

Usage

import fromDOM from 'erre.fromdom'
import erre from 'erre'

erre.install('fromDOM', fromDOM)

const resizes = erre.fromDOM(window, 'resize orientationchange', { passive: true })
const clicks = erre.fromDOM(document.body, 'click')

clicks.on.value(e => console.log(e))
resizes.on.value(e => console.log(e))

API

fromDOM

Create an erre stream from DOM events

Parameters

  • els (HTMLElement | NodeList | Array) DOM node/s where the listeners will be bound
  • eventsList String list of events we want to stream space separated
  • options Object event options (capture, once and passive)

Returns Generator erre stream generator

2.0.1

8 months ago

2.0.0

8 months ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago