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<A[keyof A]>

Defined in

Last Updated: 10 September, 2019