@pleisto/active-support
    Preparing search index...

    Variable deferConst

    defer: <TResponse>(
        func: (
            register: (
                fn: (error?: any) => any,
                options?: { rethrow?: boolean },
            ) => void,
        ) => Promise<TResponse>,
    ) => Promise<TResponse>

    Useful when for script like things where cleanup should be done on fail or sucess no matter.

    You can call defer many times to register many defered functions that will all be called when the function exits in any state.

    Type declaration

      • <TResponse>(
            func: (
                register: (
                    fn: (error?: any) => any,
                    options?: { rethrow?: boolean },
                ) => void,
            ) => Promise<TResponse>,
        ): Promise<TResponse>
      • Type Parameters

        • TResponse

        Parameters

        • func: (
              register: (
                  fn: (error?: any) => any,
                  options?: { rethrow?: boolean },
              ) => void,
          ) => Promise<TResponse>

        Returns Promise<TResponse>