@mindfulness/utils
    Preparing search index...

    Function whenAsync

    • When something is defined, do something with it.

      Type Parameters

      • T
      • R

      Parameters

      • thing: Nullable<T>

        The thing to check

      • doWork: (inp: T) => Promise<R>

        What to do if the thing is defined

      Returns Promise<Maybe<R>>

      • returns undefined if "thing" is not defined or whatever is returned from doWork