Micromodal icon indicating copy to clipboard operation
Micromodal copied to clipboard

Remove unnecessary spread, use {} as `triggerMap`

Open andreyvolokitin opened this issue 4 years ago • 1 comments

Hello. There is a problem in IE11 which needs additional polyfilling in order to work. But I also discovered that it causes errors in IE11 even with polyfills and Babel transpilation.

I found out that polyfilling Array.from is actually unnecessary: the code containing it is generated by Babel transpilation, and caused by spread operators used in the code. But what I found is that spread operators can be either easily removed (in case of converting NodeList to Array), or aren't needed at all.

I also changed triggerMap to be an object instead of array.

andreyvolokitin avatar Apr 13 '20 14:04 andreyvolokitin

BTW, by removing the spread operator we can make Micromodal more "micro" by not relying on additional spread polyfill.

andreyvolokitin avatar Aug 18 '20 19:08 andreyvolokitin