Skip to content

v1.2.0

Latest
Compare
Choose a tag to compare
@pengooseDev pengooseDev released this 31 Mar 20:25

Enhancements

useManager

  • Advanced type inference with action params

prev

    [P in keyof T['actions']]: T['actions'][P] extends WritableAtom<
      any,
      infer U,
      void
    >
      ? (param: U[0]) => void
      : never;

changed

    [P in keyof T['actions']]: T['actions'][P] extends WritableAtom<
      any,
      infer U,
      void
    >
      ? U[0] extends undefined
        ? () => void
        : (param: U[0]) => void
      : never;