Could lend some added specificity and flexibility. Would only support top-level keys, not nested properties (though this library doesn't deep merge anyway, so no one should really be using nested keys in the first place).
import { on, emit } from 'evx'
on('somePropertyKey', () => {}) // #1
on('foo', () => {}) // #2
emit('foo', { somePropertyKey: true }) // would fire #1 & #2
emit('somePropertyKey') // would fire only #1
Could lend some added specificity and flexibility. Would only support top-level keys, not nested properties (though this library doesn't deep merge anyway, so no one should really be using nested keys in the first place).