Skip to content

is this the correct syntax for deferFn #238

Open
@dagda1

Description

@dagda1

Hi,

First of all, I think this is a great project. Many thanks for the effort.

Is this the correct way to use deferFn

  const deferFn = ([args]: [Required<Credentials>]) =>
    cognitoService.confirmResetPassword(args);

  const { isPending, run } = useAsync({
    deferFn,
  });

  const [verificationCode, setVerificationCode] = useState<{
    verificationCode: string;
  }>();

I think I would prefer useFetch with {defer: true} but I am not using fetch for these calls.

Is there a better way or shy can deferFn no be like promiseFn only it is not executed immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions