How to use the react-redux-loading-bar.resetLoading function in react-redux-loading-bar

To help you get started, we’ve selected a few react-redux-loading-bar 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 jsdrupal / drupal-admin-ui / src / actions / simpleConfig.js View on Github external
function* loadSimpleConfig({ payload: { name } }) {
  try {
    yield put(resetLoading());
    yield put(showLoading());
    const config = yield call(api, 'simple_config', { $name: name });
    yield put({
      type: SIMPLE_CONFIG_LOADED,
      payload: {
        name,
        config,
      },
    });
  } catch (error) {
    yield put(setMessage(error.toString()));
  } finally {
    yield put(hideLoading());
    if (yield cancelled()) {
      // do a thing
    }
github jsdrupal / drupal-admin-ui / src / actions / simpleConfig.js View on Github external
function* postSimpleConfig({ payload: { name, config } }) {
  try {
    yield put(resetLoading());
    yield put(showLoading());

    const csrfToken = yield api('csrf_token');
    // @todo It feels like this should be moved into the api wrapper.
    yield api(
      'simple_config',
      { $name: name },
      {
        body: JSON.stringify(config),
        headers: {
          'content-type': 'application/json',
          'X-CSRF-Token': csrfToken,
        },
        method: 'PATCH',
      },
    );
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / content.js View on Github external
function* addContent({ payload: { content } }) {
  try {
    yield put(resetLoading());
    yield put(showLoading());

    yield all([
      call(api, 'node:add', { parameters: { node: content } }),
      put(requestContentTypes()),
    ]);

    // Get the content types from the redux state
    const contentTypes = yield select(contentTypesSelector);
    // Extract the content type from the content data
    const contentType = extractContentType(content);
    // Map the content type to the human-readable name
    const contentName =
      mapContentTypeToName(contentTypes, contentType) || 'unknown';

    yield put(push('/admin/content'));
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / schema.js View on Github external
function* loadSchema(action) {
  const { entityTypeId, bundle } = action.payload;
  try {
    yield put(resetLoading());
    yield put(showLoading());

    const entitySchema = yield call(api, 'schema', {
      parameters: { entityTypeId, bundle },
      queryString: { _describes: 'api_json', _format: 'schema_json' },
    });

    yield put({
      type: SCHEMA_LOADED,
      payload: {
        entityTypeId,
        bundle,
        entitySchema,
      },
    });
  } catch (error) {
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / taxonomy.js View on Github external
function* loadTaxonomyVocabulary(action) {
  try {
    yield put(resetLoading());
    yield put(showLoading());

    const { data: taxonomyVocabulary } = yield call(
      api,
      'taxonomy_vocabulary',
      {
        ...((action.payload.vocabulary && {
          queryString: {
            filter: {
              condition: { path: 'vid', value: action.payload.vocabulary },
            },
          },
        }) ||
          {}),
      },
    );
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / taxonomy.js View on Github external
function* loadTaxonomyTerms(action) {
  try {
    const {
      payload: { vocabulary },
    } = action;
    yield put(resetLoading());
    yield put(showLoading());

    const { data: taxonomyTerms } = yield call(api, 'taxonomy_term', {
      parameters: { type: vocabulary },
    });

    const {
      taxonomy: { taxonomyVocabulary },
    } = yield select();
    if (
      !(
        taxonomyVocabulary.length &&
        getTaxonomyVocabularyById(taxonomyVocabulary, vocabulary)
      )
    ) {
      yield put({
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / content.js View on Github external
function* loadSingleContent(action) {
  const {
    payload: { nid },
  } = action;
  try {
    yield put(resetLoading());
    yield put(showLoading());

    const {
      data: [content],
    } = yield call(api, 'content', {
      queryString: {
        filter: { condition: { path: 'nid', value: nid } },
      },
    });

    yield put({
      type: CONTENT_SINGLE_LOADED,
      payload: {
        content,
      },
    });
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / content.js View on Github external
function* deleteContent({ payload: { content } }) {
  try {
    yield put(resetLoading());
    yield put(showLoading());
    yield call(api, 'node:delete', { parameters: { node: content } });
  } catch (error) {
    const errorMessage = yield ApiError.errorToHumanString(error);
    yield put(setErrorMessage(errorMessage));
  } finally {
    yield put(hideLoading());
  }
}
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / content.js View on Github external
function* loadUser(action) {
  const {
    payload: { uid },
  } = action;
  try {
    yield put(resetLoading());
    yield put(showLoading());

    const {
      data: [user],
    } = yield call(api, 'user', {
      queryString: {
        filter: { condition: { path: 'uid', value: uid } },
      },
    });

    yield put({
      type: USER_LOADED,
      payload: {
        user,
      },
    });
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / schema.js View on Github external
function* loadSchemaByEntityId(action) {
  const { entityTypeId, entityId } = action.payload;
  try {
    yield put(resetLoading());
    yield put(showLoading());

    const entitySchema = yield call(api, 'schema_by_id', {
      parameters: { entityTypeId, entityId },
    });

    yield put({
      type: SCHEMA_BY_ENTITY_ID_LOADED,
      payload: {
        entityTypeId,
        entityId,
        entitySchema,
      },
    });
  } catch (error) {
    yield put(setErrorMessage(error.toString()));

react-redux-loading-bar

Simple Loading Bar for Redux and React

MIT
Latest version published 11 months ago

Package Health Score

64 / 100
Full package analysis