refactor: 💡 remove removeFromLookupCache method

This commit is contained in:
Christian Kaisermann 2019-11-21 23:33:52 -03:00
parent 66972d4b15
commit 233842baa2

View File

@ -3,7 +3,7 @@ import resolvePath from 'object-resolve-path'
import { hasLocaleDictionary } from '../stores/dictionary'
import { getGenericLocaleFrom } from './utils'
import { getFallbackLocale } from './utils'
const lookupCache: Record<string, Record<string, string>> = {}
@ -14,10 +14,6 @@ const addToCache = (path: string, locale: string, message: string) => {
return message
}
export const removeFromLookupCache = (locale: string) => {
delete lookupCache[locale]
}
export const lookupMessage = (
dictionary: any,
path: string,
@ -38,6 +34,6 @@ export const lookupMessage = (
return addToCache(
path,
locale,
lookupMessage(dictionary, path, getGenericLocaleFrom(locale))
lookupMessage(dictionary, path, getFallbackLocale(locale))
)
}