logoalt Hacker News

xigoitoday at 2:14 PM1 replyview on HN

> i could definitely see this leading to some very funky looking chaining.

At least for me,

  thing
    .doThis()
    .thenDoThat()
    .andFinallyThis()
is much more readable than

  andFinallyThis(
    thenDoThat(
      doThis(thing)
    )
  )

Replies

cupofjoakimtoday at 2:21 PM

Well, nesting is not the only option.

``` thing.doThis() thing.thenDoThat() thing.andFinallyThis()

// or

doThis(thing) thenDoThat(thing) andFinallyThis(thing) ```

show 1 reply