當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript message.loading方法代碼示例

本文整理匯總了TypeScript中antd.message.loading方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript message.loading方法的具體用法?TypeScript message.loading怎麽用?TypeScript message.loading使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在antd.message的用法示例。


在下文中一共展示了message.loading方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: loadModels

function* loadModels({ payload: { name, models } }: LoadModelsParams) {
  const { token } = yield select((state: RootState) => state.auth);
  if (token) {
    try {
      const {
        [name]: { extras },
      } = models;
      logger.debug('[loadModels]', 'loading content', { name, extras });
      message.loading(`loading content '${name}'...`);

      const response = yield call(AppContext.adapters.models.loadModels, name, extras);
      message.success(`load content '${name}' success`);
      logger.log('[loadModels]', 'loaded content', { name, response });

      yield put(
        contentActions.loadModelsSuccess({
          [name]: { data: response.data, loading: false },
        }),
      );
    } catch (e) {
      logger.warn('[loadModels]', { e });
      message.error(toErrorMessage(e));
    }
  }
}
開發者ID:danielwii,項目名稱:asuna-admin,代碼行數:25,代碼來源:content.redux.ts

示例2: reduxAction

  updatePassword: (email, password) =>
    reduxAction(securityActionTypes.UPDATE_PASSWORD, { email, password }),
};

// --------------------------------------------------------------
// Module sagas
// function* actionSage(args) {
//   yield call; yield put({ type: actionType, payload: {} })
// }
// --------------------------------------------------------------

const securitySagaFunctions = {
  *loadAllRoles() {
    const { token } = yield select((state: RootState) => state.auth);
    if (token) {
      message.loading('loading all roles...');
      try {
        const response = yield call(securityProxy.roles);
        message.success('load all roles success!');
        logger.log('[loadAllRoles]', 'response of load all roles is', response);
        yield put(securityActions.loadAllRolesSuccess(response.data));
      } catch (e) {
        logger.warn('[loadAllRoles]', 'CATCH -> load all roles error', e);
        message.error(toErrorMessage(e));
      }
    }
  },

  *getCurrentUser() {
    const { token } = yield select((state: RootState) => state.auth);
    if (token) {
開發者ID:danielwii,項目名稱:asuna-admin,代碼行數:31,代碼來源:security.redux.ts

示例3: reduxAction

  loadAllSchemasSuccess: schemas =>
    reduxAction(modelsActionTypes.LOAD_ALL_SCHEMAS_SUCCESS, { schemas }),
};

// --------------------------------------------------------------
// Module sagas
// function* actionSage(args) {
//   yield call; yield puy({ type: actionType, payload: {} })
// }
// --------------------------------------------------------------

const modelsSagaFunctions = {
  *fetch({ payload: { modelName, data }, callback }) {
    const { token } = yield select((state: RootState) => state.auth);
    if (token) {
      message.loading(`loading model '${modelName}'...`);
      try {
        const response = yield call(AppContext.adapters.models.fetch, modelName, data);
        message.success(`load model '${modelName}' success!`);
        logger.log('[fetch]', 'response of load model is', response);
        safeCallback(callback, { response });

        yield put(modelsActions.fetchSuccess(modelName, response.data));
      } catch (e) {
        logger.warn('[fetch]', e, { e });
        safeCallback(callback, { error: e });
        message.error(toErrorMessage(e));
      }
    }
  },
  /**
開發者ID:danielwii,項目名稱:asuna-admin,代碼行數:31,代碼來源:models.redux.ts

示例4: setTimeout

 export const loading =(messageInfo:string)=>{
     const hide = message.loading(messageInfo,0);
     // 異步手動移除
     setTimeout(hide, 2500);
 }
開發者ID:guoyu07,項目名稱:react-node-cms,代碼行數:5,代碼來源:SMessage.ts


注:本文中的antd.message.loading方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。