anvk / events.js Goto Github PK
View Code? Open in Web Editor NEWTiny 1.60KB (128 lines) library which allows you to add an event based communication for your components.
License: MIT License
Tiny 1.60KB (128 lines) library which allows you to add an event based communication for your components.
License: MIT License
When calling the emit() we have to wrap single object in array making it verbose.
eg: this._events.emit('eventA', [errorList]);
It would be nice to have it like this:
eg: this._events.emit('eventA', errorList);
For multiple parameters however we can wrap it in an array as such
eg: this._events.emit('eventA', [errorList, dataList]);
a11yAccordion could be a good example.
var event = new Events();
var func1 = new function() {
// should not call func1 again, but it does. Infinite loop happens.
event.emit('a',[]);
};
event.once('a', func1);
event.emit('a', []);
This counter could be used later on in the future to detect events which fire way too often or do not fire at all. Could possibly be used by users "somehow"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.