Flux - A simplistic (ES6) library for Event Delegation.
Flux is a compact library for creating individual event listeners while efficiently reducing processing overhead via Event Delegation, built off of Chris Ferdinandi's Events. Weighing in at under 150 lines of code, Flux was built in order to be used as a compact and intuitive Event Delegation library for development on the Atheos IDE, however it's proved so valuable as to become it's own mini library.
To learn more aboue Event Delegation, check out Chris' blog here
Pleasently Parsed:
Flux automatically tries to parse JSON replies.
Crazily Condensed:
The minified version is less than ~1K, roughly 500b gzipped.
Easily Extensible:
Flux is easily modifyable to meet your needs.
Below are the functions returned as an object when creating a new Flux refence.
fX('#selector'){
exists: (s) => exists(s),
list: () => list(s),
off: (t, fn) => off(t, s, fn),
on: (t, fn) => on(t, s, fn),
once: (t, fn) => once(t, s, fn),
reset: () => reset(s),
trigger: (e, o) => trigger(s, e, o)
}