vitmalina / mquery Goto Github PK
View Code? Open in Web Editor NEWDOM manipulation library, the ES6 way!
License: MIT License
DOM manipulation library, the ES6 way!
License: MIT License
JQuery and Cash store the original display value and restore it again correctly.
Currently mQuery sets the display value to none/inherit
, which can often be wrong, e.g. if the original display value was flex
or hidden
.
JQuery uses some sort of private cache: https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/css/showHide.js
Cash uses some combination of storing the display value in a ___cd
property on the element and calculating the display value based on inserting a temporary DOM element: https://github.com/fabiospampinato/cash/blob/1c1b316e53cc3322e417a93a0e7c4745852796d0/dist/cash.ts
A great feature of jQuery when dealing with memory leaks was that it automatically cleaned data attributes and event listeners when nodes are removed or emptied.
Could you add this also to the empty and other dom node cleaning methods in this library?
Use data attributes
.data(name, 1) => el.dataset.name
It will be very useful to be able to do event delegation the jQuery way. This will greatly increase the speed of handling events - as you will handle them in a central place.
https://javascript.info/event-delegation
https://learn.jquery.com/events/event-delegation/
Maybe by passing a delegate: 'elem-selector'
in the options of on() ?
it can be easily done with css selctor matches, like:
https://gomakethings.com/event-delegation-and-multiple-selectors-with-vanilla-js/
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.