ExtFalsy<T> extension

Extension that adds falsy/truthy helpers to nullable values.

on
  • T?

Properties

isFalsy bool

Available on T?, provided by the ExtFalsy extension

Returns true if this value is considered falsy.
no setter
isTruthy bool

Available on T?, provided by the ExtFalsy extension

Returns true if this value is not falsy.
no setter

Methods

dependsOn<R>(R? value) → T?

Available on T?, provided by the ExtFalsy extension

Returns this value only if value is truthy.
onlyIf(bool? condition) → T?

Available on T?, provided by the ExtFalsy extension

Returns this value only if condition is true.
or(T fallback) → T

Available on T?, provided by the ExtFalsy extension

Returns this value if it is truthy, otherwise returns fallback.