@laserware/stasis
    Preparing search index...

    Function createAction

    • A utility function to create an action creator for the given action type string. The action creator accepts a single argument, which will be included in the action object as a field called payload. The action creator function will also have its toString() overridden so that it returns the action type.

      Type Parameters

      • P = void
      • T extends string = string

      Parameters

      • type: T

        The action type to use for created actions.

      Returns IsAny<P, ActionCreatorWithPayload<any, T>>

    • A utility function to create an action creator for the given action type string. The action creator accepts a single argument, which will be included in the action object as a field called payload. The action creator function will also have its toString() overridden so that it returns the action type.

      Type Parameters

      Parameters

      • type: T

        The action type to use for created actions.

      • prepareAction: PA

      Returns IfPrepareActionMethodProvided<
          PA,
          _ActionCreatorWithPreparedPayload<PA, T>,
          IsAny<
              ReturnType<PA>["payload"],
              ActionCreatorWithPayload<any, T>,
              IsUnknown<
                  ReturnType<PA>["payload"],
                  ActionCreatorWithNonInferrablePayload<T>,
                  IfVoid<
                      ReturnType<PA>["payload"],
                      ActionCreatorWithoutPayload<T>,
                      IfMaybeUndefined<
                          ReturnType<PA>["payload"],
                          ActionCreatorWithOptionalPayload<ReturnType<PA>["payload"], T>,
                          ActionCreatorWithPayload<ReturnType<PA>["payload"], T>,
                      >,
                  >,
              >,
          >,
      >