• 2 Posts
  • 127 Comments
Joined 1 year ago
cake
Cake day: July 2nd, 2023

help-circle



  • OP: “typescript is easy and rust is ugly”

    Typescript :

    export type PayloadActionCreator<
      P = void,
      T extends string = string,
      PA extends PrepareAction<P> | void = void
    > = IfPrepareActionMethodProvided<
      PA,
      _ActionCreatorWithPreparedPayload<PA, T>,
      // else
      IsAny<
        P,
        ActionCreatorWithPayload<any, T>,
        IsUnknownOrNonInferrable<
          P,
          ActionCreatorWithNonInferrablePayload<T>,
          // else
          IfVoid<
            P,
            ActionCreatorWithoutPayload<T>,
            // else
            IfMaybeUndefined<
              P,
              ActionCreatorWithOptionalPayload<P, T>,
              // else
              ActionCreatorWithPayload<P, T>
            >
          >
        >
      >
    >