@vsokolov/utils - v1.4.2
    Preparing search index...

    Function tap

    • Pass the value through the callback, and return the value

      Type Parameters

      • T

      Parameters

      • value: T

        The value to pass through

      • callback: (value: T) => void

        Callback to execute with the value

      Returns T

      The original value unchanged

      function createUser(name: string): User {
      return tap(new User, user => {
      user.name = name
      })
      }