Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 352 Bytes

readme.md

File metadata and controls

24 lines (18 loc) · 352 Bytes

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')