这段代码与打字稿混淆了什么?这里有多少个参数?是actionType和有效负载参数?

时间:2019-06-18 15:51:45

标签: reactjs typescript react-hooks

export function createActionPayload<TypeAction, TypePayload>(  actionType: TypeAction): (payload: TypePayload) => ActionsWithPayload<TypeAction, TypePayload> {
      return (p: TypePayload): ActionsWithPayload<TypeAction, TypePayload> => {
        return {
          payload: p,
          type: actionType
        };
      };
    }

这是发送动作的功能

0 个答案:

没有答案