本文整理匯總了TypeScript中reqwest.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getResult
export function getResult(toSend: { token: string }, successCallback: (result: { error?: boolean, description?: string }) => void) {
reqwest({
url: '/result_killer',
method: 'post',
data: toSend,
error: () => {
successCallback({
error: true
})
},
success: successCallback
});
}
示例2: loadTeam
export function loadTeam(toSend: TeamsRequest, successCallback: (res: TeamsResponse) => void) {
reqwest({
url: '/teams',
method: 'post',
data: toSend,
error: () => {
successCallback({
success: false
})
},
success: successCallback
});
}
示例3: saveAnswers
export function saveAnswers(toSend: AnswersUpdateRequest, successCallback: (res: AnswersUpdateResponse) => void) {
reqwest({
url: '/save',
method: 'post',
data: toSend,
error: () => {
successCallback({
success: false
})
},
success: successCallback
});
}
示例4: loadQuestions
export function loadQuestions(toSend: QuestTextsRequest, successCallback: (res: QuestTextsResponse) => void) {
reqwest({
url: '/quest-texts',
method: 'post',
data: toSend,
error: () => {
successCallback({
success: false
})
},
success: successCallback
})
}
示例5: unlockLastStage
export function unlockLastStage(toSend: UnlockLastCompletedStageRequest, successCallback: (res: UnlockLastCompletedStageResponse) => void) {
reqwest({
url: '/unlock-stage',
method: 'post',
data: toSend,
error: () => {
successCallback({
success: false
})
},
success: successCallback
});
}
示例6: getAWSSign
export function getAWSSign(toSend: GetAWSSignRequest, successCallback: (res: GetAWSSignResponse) => void) {
reqwest({
url: '/sign_s3',
method: 'post',
data: toSend,
error: () => {
successCallback({
success: false
})
},
success: successCallback
});
}
示例7: authRequest
export function authRequest(toSend: LoginRequest, callback: (info: LoginInfo) => void) {
reqwest({
url: '/login',
method: 'post',
data: toSend,
error: () => {
callback({
authenticated: false
})
},
success: callback
});
}
示例8: getRestTime
export function getRestTime(toSend: GetRestTimeRequest, successCallback: (res: GetRestTimeResponse) => void) {
reqwest({
url: '/rest-time',
method: 'post',
data: toSend,
error: () => {
successCallback({
success: false
})
},
success: successCallback
});
}
示例9: removeTeam
export function removeTeam(toSend: RemoveTeamRequest, successCallback: (res: RemoveTeamResponse) => void) {
reqwest({
url: '/remove-team',
method: 'post',
error: () => {
successCallback({
success: false
})
},
data: toSend,
success: successCallback
});
}
示例10: complete
export function complete(toSend: AnswersUpdateRequest, successCallback: (res: CompleteStageResponse) => void) {
reqwest({
url: '/complete',
method: 'post',
data: toSend,
error: () => {
successCallback({
error: true,
success: false
})
},
success: successCallback
});
}