0.2.0 • Published 2 years ago

@sonicgarden/onconnect v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

onconnect

Run something when a DOM element appears and when it exits.

Installation

npm install @sonicgarden/onconnect
yarn add @sonicgarden/onconnect
pnpm install @sonicgarden/onconnect

Usage

import { onConnect } from '@sonicgarden/onconnect'

onConnect('[data-popover]', (el) => {
  const popover = new Popover(el)

  // optional
  return () => {
    popover.destroy()
  }
})

Inspired by onmount.

0.2.0

2 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago