when method

S when(
  1. bool test,
  2. S build(
    1. S query
    )
)

Rebuilds this query through build only when test is true.

Implementation

S when(bool test, S Function(S query) build) {
  if (!test) return _self;
  return build(_self);
}