Discussion: How much to pipeline

My rule a thumb is

For non view code:

  • Use <| or parens for one liners
  • Use |> when more than 1 function is applied to a value

For view code:

  • Favour <| for building html hierarchies (I like the code to fit the html structure as far as possible)
  • Only use |> when assigning values in let blocks, never in the body of the let or any other expressions. Put another way, I only use |> to calculate values which are then used to express the html.
4 Likes