@music-lyric-player/utils
v0.18.1
Published
Music Lyric Player - Utils
Readme
@music-lyric-player/utils
Internal helpers consumed by @music-lyric-player/base and @music-lyric-player/dom. You usually do not need to install this directly — it is pulled in transitively.
Install
npm install @music-lyric-player/utilsExample
import { ConfigManager, Event } from '@music-lyric-player/utils'
const config = new ConfigManager({ foo: 1, bar: { baz: 2 } }, {})
config.event.add('update', (changedKeys) => {
// changedKeys is a Set of changed key paths, e.g. Set { 'bar.baz' }
})
config.merge({ bar: { baz: 3 } })
const event = new Event()
event.add('hello', (name) => console.log(`hi ${name}`))
event.emit('hello', 'world')