remove lodash forEach to reduce bundle size (#156)
This commit is contained in:
		
							parent
							
								
									7c548018c1
								
							
						
					
					
						commit
						74ea773c25
					
				
					 3 changed files with 4 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -1,7 +1,6 @@
 | 
			
		|||
import { getIdsThatRebloggedThisStatus, getNotificationIdsForStatuses } from './statuses'
 | 
			
		||||
import { store } from '../_store/store'
 | 
			
		||||
import { scheduleIdleTask } from '../_utils/scheduleIdleTask'
 | 
			
		||||
import forEach from 'lodash-es/forEach'
 | 
			
		||||
import isEqual from 'lodash-es/isEqual'
 | 
			
		||||
import {
 | 
			
		||||
  deleteStatusesAndNotifications as deleteStatusesAndNotificationsFromDatabase
 | 
			
		||||
| 
						 | 
				
			
			@ -12,7 +11,8 @@ function filterItemIdsFromTimelines (instanceName, timelineFilter, idFilter) {
 | 
			
		|||
 | 
			
		||||
  keys.forEach(key => {
 | 
			
		||||
    let timelineData = store.getAllTimelineData(instanceName, key)
 | 
			
		||||
    forEach(timelineData, (ids, timelineName) => {
 | 
			
		||||
    Object.keys(timelineData).forEach(timelineName => {
 | 
			
		||||
      let ids = timelineData[timelineName]
 | 
			
		||||
      if (!timelineFilter(timelineName)) {
 | 
			
		||||
        return
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,8 +14,6 @@ import {
 | 
			
		|||
  USERNAME_LOWERCASE
 | 
			
		||||
} from './constants'
 | 
			
		||||
 | 
			
		||||
import forEach from 'lodash-es/forEach'
 | 
			
		||||
 | 
			
		||||
const openReqs = {}
 | 
			
		||||
const databaseCache = {}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -47,8 +45,8 @@ export function getDatabase (instanceName) {
 | 
			
		|||
          ? db.createObjectStore(name, init)
 | 
			
		||||
          : db.createObjectStore(name)
 | 
			
		||||
        if (indexes) {
 | 
			
		||||
          forEach(indexes, (indexValue, indexKey) => {
 | 
			
		||||
            store.createIndex(indexKey, indexValue)
 | 
			
		||||
          Object.keys(indexes).forEach(indexKey => {
 | 
			
		||||
            store.createIndex(indexKey, indexes[indexKey])
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -69,7 +69,6 @@ module.exports = {
 | 
			
		|||
  },
 | 
			
		||||
  plugins: [
 | 
			
		||||
    new LodashModuleReplacementPlugin({
 | 
			
		||||
      collections: true,
 | 
			
		||||
      caching: true
 | 
			
		||||
    })
 | 
			
		||||
  ].concat(isDev ? [
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue