cleaned up lodash imports
This commit is contained in:
parent
f9767ec3cf
commit
1ee18a7fa3
15 changed files with 19 additions and 27 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import _ from 'lodash'
|
||||
import { maxBy, minBy } from 'lodash'
|
||||
|
||||
const empty = (chatId) => {
|
||||
return {
|
||||
|
|
@ -42,12 +42,12 @@ const deleteMessage = (storage, messageId) => {
|
|||
delete storage.idIndex[messageId]
|
||||
|
||||
if (storage.maxId === messageId) {
|
||||
const lastMessage = _.maxBy(storage.messages, 'id')
|
||||
const lastMessage = maxBy(storage.messages, 'id')
|
||||
storage.maxId = lastMessage.id
|
||||
}
|
||||
|
||||
if (storage.minId === messageId) {
|
||||
const firstMessage = _.minBy(storage.messages, 'id')
|
||||
const firstMessage = minBy(storage.messages, 'id')
|
||||
storage.minId = firstMessage.id
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import isFunction from 'lodash/isFunction'
|
||||
import { isFunction } from 'lodash'
|
||||
|
||||
const getComponentOptions = (Component) =>
|
||||
isFunction(Component) ? Component.options : Component
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import ISO6391 from 'iso-639-1'
|
||||
import _ from 'lodash'
|
||||
import { map } from 'lodash'
|
||||
|
||||
import languagesObject from '../../i18n/messages'
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ const getLanguageName = (code) => {
|
|||
)
|
||||
}
|
||||
|
||||
const languages = _.map(languagesObject.languages, (code) => ({
|
||||
const languages = map(languagesObject.languages, (code) => ({
|
||||
code,
|
||||
name: getLanguageName(code),
|
||||
})).sort((a, b) => a.name.localeCompare(b.name))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue