npm show webpack@* version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// As long as it continues to be invoked, the callback will not be triggered. | |
// The function will be called after it stops being called for N milliseconds. | |
const debounce = (callback, wait) => { | |
// there is no timeout by default | |
let timeout = null | |
return function(...args) { | |
// last timeout is cleared every time after first call | |
clearTimeout(timeout) | |
// callback will only be fired if it was not cleared by invocation occuring before N milliseconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// default shade value of 200, increment up to 255 for brighter colors, deincrement down to 0 for darker colors | |
const generateRandomRGB = (shade = 200, alpha = 1) => { | |
shade = (shade >= 0 && shade <= 255) ? shade : 255; | |
const generateRandomColor = () => { | |
return Math.ceil(Math.random() * shade); | |
} | |
const red = generateRandomColor(shade); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeByKey (myObj, deleteKey) { | |
return Object.keys(myObj) | |
.filter(key => key !== deleteKey) | |
.reduce((result, current) => { | |
result[current] = myObj[current]; | |
return result; | |
}, {}); | |
} | |
// Helper function |
Based on D3 Stacked Bar Chart by Mike Bostock https://bl.ocks.org/mbostock/3886208
Tooltip code based on D3 Stacked Bar Chart with Tooltips by Michael Stanaland http://bl.ocks.org/mstanaland/6100713
Based on D3 Stacked Bar Chart by Mike Bostock https://bl.ocks.org/mbostock/3886208
Tooltip code based on D3 Stacked Bar Chart with Tooltips by Michael Stanaland http://bl.ocks.org/mstanaland/6100713
prettier-eslint |
eslint-plugin-prettier |
eslint-config-prettier |
|
---|---|---|---|
What it is | A JavaScript module exporting a single function. | An ESLint plugin. | An ESLint configuration. |
What it does | Runs the code (string) through prettier then eslint --fix . The output is also a string. |
Plugins usually contain implementations for additional rules that ESLint will check for. This plugin uses Prettier under the hood and will raise ESLint errors when your code differs from Prettier's expected output. | This config turns off formatting-related rules that might conflict with Prettier, allowing you to use Prettier with other ESLint configs like eslint-config-airbnb . |
How to use it | Either calling the function in your code or via [prettier-eslint-cli ](https://github.co |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# editorconfig.org | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
NewerOlder