How to use the tc-source-content-updater function in tc-source-content-updater

To help you get started, we’ve selected a few tc-source-content-updater examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unfoldingWord / translationCore / src / js / actions / SourceContentUpdatesActions.js View on Github external
import sourceContentUpdater from 'tc-source-content-updater';
import {
  getTranslate, getContext, getSelectedToolName, getProjectSaveLocation, getProjectBookId,
} from '../selectors';
// helpers
import { getLocalResourceList } from '../helpers/sourceContentUpdatesHelpers';
import { copyGroupDataToProject, updateSourceContentUpdaterManifest } from '../helpers/ResourcesHelpers';
import { getOrigLangforBook } from '../helpers/bibleHelpers';
import * as Bible from '../common/BooksOfTheBible';
import { loadBookTranslations } from './ResourcesActions';
import {
  openAlertDialog, closeAlertDialog, openOptionDialog,
} from './AlertModalActions';
import consts from './ActionTypes';
// constants
const SourceContentUpdater = new sourceContentUpdater();
const USER_RESOURCES_PATH = path.join(ospath.home(), 'translationCore/resources');

/**
 * Resets the state of the source content updates reducer.
 */
export const resetSourceContentUpdatesReducer = () => ({ type: consts.RESET_LIST_OF_SOURCE_CONTENT_TO_UPDATE });

export const updateSourceContentUpdatesReducer = () => ({ type: consts.SOURCE_CONTENT_UPDATED });

const failedAlertAndRetry = (closeSourceContentDialog, retryCallback, failAlertMessage) => ((dispatch, getState) => {
  const translate = getTranslate(getState());

  dispatch(
    openOptionDialog(
      translate(failAlertMessage),
      () => dispatch(retryCallback()),

tc-source-content-updater

Module that updates source content for the desktop application translationCore.

MIT
Latest version published 15 days ago

Package Health Score

64 / 100
Full package analysis