refactor: 💡 rename addMessagesTo to addMessages

This commit is contained in:
Christian Kaisermann 2019-11-21 22:12:56 -03:00
parent 6ee28e7d27
commit 06946ee3d1
4 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@ import { MessagesLoader } from '../types'
import {
hasLocaleDictionary,
$dictionary,
addMessagesTo,
addMessages,
} from '../stores/dictionary'
import { getCurrentLocale } from '../stores/locale'
import { $isLoading } from '../stores/loading'
@ -62,7 +62,7 @@ export async function flushQueue(locale: string = getCurrentLocale()) {
partials = partials.map(partial => partial.default || partial)
removeFromLookupCache(locale)
addMessagesTo(locale, ...partials)
addMessages(locale, ...partials)
})
.then(() => {
clearTimeout(loadingDelay)

View File

@ -20,7 +20,7 @@ export { $locale as locale, loadLocale as preloadLocale } from './stores/locale'
export {
$dictionary as dictionary,
$locales as locales,
addMessagesTo,
addMessages,
} from './stores/dictionary'
export { $isLoading as isLoading } from './stores/loading'
export { $format as format, $format as _, $format as t } from './stores/format'

View File

@ -18,7 +18,7 @@ function hasLocaleDictionary(locale: string) {
return locale in dictionary
}
function addMessagesTo(locale: string, ...partials: LocaleDictionary[]) {
function addMessages(locale: string, ...partials: LocaleDictionary[]) {
$dictionary.update(d => {
dictionary[locale] = merge.all([dictionary[locale] || {}].concat(partials))
return d
@ -34,5 +34,5 @@ export {
$locales,
getDictionary,
hasLocaleDictionary,
addMessagesTo,
addMessages,
}

View File

@ -1,4 +1,4 @@
// todo this is a mess
// TODO remake this, it's a mess
import { Formatter } from '../../src/client/types'
import {
dictionary,