当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript react-promise-tracker.trackPromise函数代码示例

本文整理汇总了TypeScript中react-promise-tracker.trackPromise函数的典型用法代码示例。如果您正苦于以下问题:TypeScript trackPromise函数的具体用法?TypeScript trackPromise怎么用?TypeScript trackPromise使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了trackPromise函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: trackPromise

export const fetchMembersAction = () => (dispatch) => {
  trackPromise(
    memberAPI.fetchMembersAsync()
    .then((members) => {
      dispatch(fetchMembersCompleted(members));
    })
  );
};
开发者ID:Lemoncode,项目名称:react-typescript-samples,代码行数:8,代码来源:fetchMembers.ts

示例2: trackPromise

export const memberFieldChangeAction = (member: MemberEntity, fieldName: string, value: any) => (dispatch) => {
  trackPromise(
    memberFormValidation.validateField(member, fieldName, value)
    .then((fieldValidationResult) => {
      dispatch(memberFieldChangeCompleted(fieldValidationResult, value));
    })
    );
};
开发者ID:Lemoncode,项目名称:react-typescript-samples,代码行数:8,代码来源:memberFieldChange.ts

示例3: trackPromise

export const fetchMemberByIdAction = (id: number) => (dispatch) => (
  trackPromise(
    memberAPI.fetchMemberByIdAsync(id)
      .then((member) => {
        dispatch(fetchMemberByIdCompleted(member));
      })
  )
);
开发者ID:Lemoncode,项目名称:react-typescript-samples,代码行数:8,代码来源:fetchMemberById.ts

示例4: trackPromise

export const fetchRepositoriesAction = () => (dispatch) => {
    trackPromise(
        memberAPI.fetchRepositoriesAsync()
            .then((repos) => {
                dispatch(fetchReposCompleted(repos));
            })
    );
};
开发者ID:Lemoncode,项目名称:react-typescript-samples,代码行数:8,代码来源:fetchRepositories.ts

示例5: trackPromise

export const fetchMembers = () => (dispatch) => (
  trackPromise(
    memberAPI.fetchMembers()
    .then((members) => {
      dispatch(fetchMembersCompleted(members));
    })
  )
  );
开发者ID:Lemoncode,项目名称:react-typescript-samples,代码行数:8,代码来源:fetchMembers.ts

示例6: trackPromise

const saveMember = (member: MemberEntity) => {
  trackPromise(
    memberAPI.saveMember(member)
      .then(() => {
        toastr.success('Member saved.');
        history.back();
      })
      .catch(toastr.error)
  );
};
开发者ID:Lemoncode,项目名称:react-typescript-samples,代码行数:10,代码来源:saveMember.ts

示例7: trackPromise

export const saveMemberAction = (member: MemberEntity) => (dispatch) => {
  trackPromise(
    memberFormValidation.validateForm(member)
      .then((formValidationResult) => {
        if (formValidationResult.succeeded) {
          saveMember(member);
        }
        dispatch(saveMemberActionCompleted(formValidationResult));
      })
    );
};
开发者ID:Lemoncode,项目名称:react-typescript-samples,代码行数:11,代码来源:saveMember.ts


注:本文中的react-promise-tracker.trackPromise函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。