How to use the react-redux-loading-bar.showLoading 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 nginyc / rafiki / web / src / sagas / JobsSagas.js View on Github external
export function* getTrialsListOfJob(action) {
    try {
        // Get Trials list and display notification 
        yield put(showLoading()) 
        const token = yield select(getToken)
        yield call(getJobsList, action)
        console.log("Getting Trials List of Job")
        const trialsList = yield call(api.requestTrialsOfJob, {}, token, action.app, action.appVersion) 
        yield put(actions.populateTrialsToJobs(trialsList.data, action.app, action.appVersion))
        yield put(hideLoading())
    } catch(e) {
        console.error(e.response)
        console.error(e)
        yield put(notificationShow("Failed to Fetch TrialsList"))
    }
}
github nginyc / rafiki / web / src / sagas / DatasetsSagas.js View on Github external
function* createDataset(action) {
    const {name, task, file, dataset_url} = action
    try {
        yield put(showLoading())
        const token = yield select(getToken)
        yield call(api.postCreateDataset, name, task, file, dataset_url, token)
        console.log("Create Dataset success")
        yield alert("Create Dataset success")
        yield put(notificationShow("Create Dataset Success")); // no need to write test for this 
        yield(push('console/datasets/list-dataset'))
        yield put(hideLoading())
    } catch(e) {
        console.error(e.response)
        console.error(e)
        console.error(e.response.data)
        yield put(notificationShow("Failed to Create Dataset"));
    }
}
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / roles.js View on Github external
function* loadRoles() {
  try {
    yield put(resetLoading());
    yield put(showLoading());
    const roles = yield call(api, 'roles');
    yield put({
      type: ROLES_LOADED,
      payload: {
        roles,
      },
    });
  } catch (error) {
    const errorMessage = yield ApiError.errorToHumanString(error);
    yield put(setErrorMessage(errorMessage));
  } finally {
    yield put(hideLoading());
    if (yield cancelled()) {
      // do a thing
    }
  }
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,
      },
    });
  } catch (error) {
github CodeChain-io / codechain-explorer / src / request / ApiRequest.tsx View on Github external
const showLoadingBar = () => {
        if (showProgressBar) {
            dispatch(showLoading(progressBarTarget));
        }
    };
github jsdrupal / drupal-admin-ui / packages / admin-ui / src / actions / reports.js View on Github external
},
                },
              }),
              {
                severityGroup: {
                  group: {
                    conjunction: 'OR',
                  },
                },
              },
            )
          : {}),
      },
    };
    yield put(resetLoading());
    yield put(showLoading());
    yield put({
      type: DBLOG_FILTER_UPDATED,
      payload: {
        options,
      },
    });
    const dbLogEntriesTypes = yield call(api, 'dblog:types');
    const dbLogEntries = yield call(api, 'dblog', { queryString });
    yield put({
      type: DBLOG_COLLECTION_LOADED,
      payload: {
        dbLogEntries,
        dbLogEntriesTypes,
      },
    });
  } catch (error) {
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,
      },
    });
  } catch (error) {
github FrontSpot-Community / code-battle / src / sagas / userSaga.js View on Github external
function* editUser({payload}) {
  try {
    yield put(showLoading());
    yield put(userLoading());
    const submitResult = yield call(changeUserInfo, payload);
    yield put(userFetchSuccess(submitResult));
  } catch (e) {
    yield put(userFetchFailed(e.data));
  } finally {
    yield put(hideLoading());
  }
}
github LastDreamer / react-router-prefetch / stories / components / Page3.jsx View on Github external
return new Promise((resolve) => {
      props.dispatch(showLoading());

      setTimeout(() => {
        props.dispatch(hideLoading());

        resolve(props);
      }, 1000);
    });
  }

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