UNPKG

fastcomments-react-native-sdk

Version:

React Native FastComments Components. Add live commenting to any React Native application.

19 lines (18 loc) 686 B
export function getMergedTranslations(sourceTranslations, response) { let translations = sourceTranslations; if (response.translations) { // we will move some of these error messages to only be sent to client on error (LOGIN_TO_DELETE) translations = { ...translations, ...response.translations }; } return translations; } export function addTranslationsToState(stateTranslations, translations) { stateTranslations.set((stateTranslations) => { for (const translationId in translations) { stateTranslations[translationId] = translations[translationId]; } return stateTranslations; }); }