plainfp - v0.1.1
    Preparing search index...

    Function value

    • Bind a pure computed field onto the builder scope. fn receives the accumulated scope and returns a plain value — it never short-circuits.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • S
      • N extends string
      • A

      Parameters

      Returns OptionType<
          {
              [K in string
              | number
              | symbol]: (Omit<S, N> & { readonly [K in string]: A })[K]
          },
      >

      pipe(
      build(),
      field("user", () => findUser(id)),
      value("greeting", ({ user }) => `Hi ${user.name}`),
      map(({ greeting }) => greeting),
      )
    • Bind a pure computed field onto the builder scope. fn receives the accumulated scope and returns a plain value — it never short-circuits.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • S
      • N extends string
      • A

      Parameters

      • name: N
      • fn: (scope: S) => A

      Returns (
          acc: OptionType<S>,
      ) => OptionType<
          {
              [K in string
              | number
              | symbol]: (Omit<S, N> & { readonly [K in string]: A })[K]
          },
      >

      pipe(
      build(),
      field("user", () => findUser(id)),
      value("greeting", ({ user }) => `Hi ${user.name}`),
      map(({ greeting }) => greeting),
      )