also method

T also(
  1. void block(
    1. T
    )
)

Calls block with this value for a side effect, then returns this value.

Useful for logging, debugging, or mutation without breaking a chain.

fetchUser()
  .also((u) => print('Fetched: ${u.name}'))
  .also((u) => analytics.track(u));

Implementation

T also(void Function(T) block) {
  block(this);
  return this;
}