TypeScript @-actions-appArgs.endLoading类(方法)实例源码

下面列出了TypeScript @-actions-appArgs.endLoading 类(方法)源码代码实例,从而了解它的用法。

作者:Zulus    项目:Budgetariu   
return (dispatch: Redux.Dispatch<any, IState>, getState: () => IState) => {
     dispatch(endLoading(scope));
     if (message) {
         dispatch(addError(scope, message));
     } else {
         dispatch(addError(scope, "Some error"));
     }
 };

作者:Zulus    项目:Budgetariu   
.then(response => {
     const answer = response.data as any;
     clientAccess.cache.reset();
     if (!answer || !answer.wallets) {
         throw Error("Server returns empty response");
     } else {
         dispatch(endLoading("wallets"));
         dispatch(walletsLoadSuccess(answer.wallets as any));
     }
 })

作者:Zulus    项目:Budgetariu   
.then((response: any) => {
     if (!response.data) {
         throw Error("Server returns empty response");
     } else {
         clientAccess.cache.reset();
         const {token, expiredIn} = response.data.access;
         dispatch(authUpdateAccessToken({token, expiredIn}));
         dispatch(endLoading("auth"));
     }
 })

作者:Zulus    项目:Budgetariu   
.then(response => {
     const answer = (response.data as any);
     clientAccess.cache.reset();
     if (!answer) {
         throw Error("Server returns empty response");
     } else {
         dispatch(endLoading("transactions"));
         dispatch(removeTransactionFromSelectedWallet(id));
         dispatch(transactionDeleteSuccess(id));
     }
 })

作者:Zulus    项目:Budgetariu   
.then(response => {
     dispatch(endLoading("transactions"));
     if (!response.data) {
         throw Error("Server returns empty response");
     } else {
         const w = (response.data.createTransaction as ITransactionCreateMutationResponse);
         const transaction = {
             ...w,
         };
         dispatch(transactionCreationSuccess(transaction as any));
     }
 })

作者:Zulus    项目:Budgetariu   
.then(response => {
     dispatch(endLoading("wallet"));
     if (!response.data) {
         throw Error("Server returns empty response");
     } else {
         const w = (response.data.createWallet as IWalletCreateMutationResponse);
         const wallet = {
             ...w,
             ownerId: (w.owner.id as string)
         };
         dispatch(walletCreationSuccess(wallet as any));
     }
 })


问题


面经


文章

微信
公众号

扫码关注公众号