本文整理汇总了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));
}
}
}
示例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) {
示例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));
}
}
},
/**
示例4: setTimeout
export const loading =(messageInfo:string)=>{
const hide = message.loading(messageInfo,0);
// 异步手动移除
setTimeout(hide, 2500);
}