alsoscotland / react-super-select

MIT License
95 stars 33 forks source link

Import only used lodash methods #101

Closed th3fallen closed 7 years ago

th3fallen commented 7 years ago

instead of import _ from 'lodash' as seen in https://github.com/alsoscotland/react-super-select/blob/master/src/react-super-select.js#L11

do import {values, uniqueId, bindAll, isArray, isFunction, isUndefined, isEqual, extend, isEmpty, head, isObject, isString, map, reject, includes, isNumber, groupBy, forIn, find, noop, reduce, } from 'lodash'; < jeez you use a ton of them....

alsoscotland commented 7 years ago

Thanks!
https://github.com/alsoscotland/react-super-select/tree/v0.5.16

th3fallen commented 7 years ago

also on that topic is there a reason you use lodash's _.map method vs the built in one?

alsoscotland commented 7 years ago

@th3fallen I started this component with some pre-babel ES5 code. Never converted it. Interestingly though, check this out https://jsperf.com/native-map-vs-lodash-map

th3fallen commented 7 years ago

well, i'll be damned.... point taken... TIL