pell icon indicating copy to clipboard operation
pell copied to clipboard

Make pell.js even smaller in size

Open jaredreich opened this issue 7 years ago • 3 comments

Please post suggestions here if you have any, thanks!

jaredreich avatar Mar 12 '18 19:03 jaredreich

Something fast and easy...

Shortcuts like:

const addEventListener = (parent, type, listener) => parent.addEventListener(type, listener)
const appendChild = (parent, child) => parent.appendChild(child)
const createElement = tag => document.createElement(tag)
const queryCommandState = command => document.queryCommandState(command)
const queryCommandValue = command => document.queryCommandValue(command)

export const exec = (command, value = null) => document.execCommand(command, false, value)

could be removed :)

bcolucci avatar Mar 20 '18 11:03 bcolucci

https://github.com/jaredreich/pell/pull/108 Save about 13%

bcolucci avatar Mar 20 '18 13:03 bcolucci

I made several optimizations in my fork, you might be interested: https://github.com/sylvainpolletvillard/spell/blob/master/spell.js

sylvainpolletvillard avatar Mar 21 '18 22:03 sylvainpolletvillard