ActionsUnion<A extends ActionCreatorsObject> Type alias

A TypeScript type alias that represents the Union Type of all actions possibly created by any of the action creators in a given ActionCreatorsObject.

For example,

  // given:
  const MyActionCreators = {
    createBanana: () => createAction("BANANA"),
    createApple:  () => createAction("APPLE", true),
    createOrange: (n: number) => createAction("BANANA", n),
  }
  // then:
  type X = ActionsUnion<typeof MyActionCreators>;
  // is equivalent to:
  type X = Action<"BANANA">
           | ActionWithPayload<"APPLE", boolean>
           | ActionWithPayload<"ORANGE", number>;

ActionsUnion = ReturnType<>

Defined in

Last Updated: 30 November, 2023