2. Based around native DOM functions - so it's pretty damn fast. See https://github.com/roecrew/zam/ for benchmarks. Or make your own at https://jsperf.com/.
3. Zam doesn't have a jQuery Object equivalent. instead zam has two properties -- 'self' and 'functions'.
'self' is a String value of the last used selector (default 'html'), and 'functions' stores all event handlers. I find 'functions' to be considerably helpful.
zam.off() and zam.on() third parameter can receive a function or string that's a function name.
Consider the following example...
var zam = new Zam();
setTimeout(() => {
zam.off('mouseup', 'h1:nth-of-type(2)', 'mUpH1');
// or zam.off('mouseup', 'h1:nth-of-type(2)', mUpH1);
}, 5000);zam.on('mouseup', 'h1:nth-of-type(2)', (mUpH1 = (e) => {
...
}));Now, what if we were using 'strict mode'. Then we could do this.
setTimeout(() => {
zam.off('mouseup', 'h1:nth-of-type(2)', 'mUpH1');
// or zam.off('mouseup', 'h1:nth-of-type(2)', mUpH1);
}, 5000);zam.on('mouseup', 'h1:nth-of-type(2)', function mUpH1(e) => {
...
});The overall goal of this library is to stay close to vanillajs, and be easily modifiable.
What do you guys think?
http://zamjs.com