choo-emit-once

1.1.0 • Public • Published

Choo emit.once

Emit once per route change

npm install choo-emit-once

Usage

const choo = require('choo')
const emitOnce = require('choo-emit-once')

const app = choo()

app.use(emitOnce)

app.route('/', function (state, emit) {
  emit.once('event-name')
  emit.clear('event-name')
  emit.clear()
})

app.mount('body')

Readme

Keywords

none

Package Sidebar

Install

npm i choo-emit-once

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

1.13 kB

Total Files

3

Last publish

Collaborators

  • jenslind