Skip to content

Instantly share code, notes, and snippets.

Avatar

Lucas Paulger lpaulger

View GitHub Profile
@lpaulger
lpaulger / example.js
Created Jun 30, 2016
code dilution example
View example.js
function example(options) {
const {injectedLibrary} = options;
//DON'T
this.methodOne = function(){
doSomethingInjectedLibrary('methodOne')
}
this.methodTwo = function(){
doSomethingInjectedLibrary('methodTwo')
@lpaulger
lpaulger / example.js
Last active Jun 30, 2016
good parameters example
View example.js
//DO
function example(options) {
//this clearly identifies what the expected parameters are
const {
injectedLibrary,
otherThing
} = options;
this.methodOne = function(){
injectedLibrary.doSomething('methodOne')