unref<R> function

R unref<R>(
  1. dynamic ref
)

Unwraps a Ref instance if the given value is a Ref, otherwise returns the value as-is.

If ref is a Ref, returns its value. If ref is not a Ref, returns ref unchanged.

R is the type of the unwrapped value.

Implementation

R unref<R>(ref) {
  if (ref is public.Ref) {
    return ref.value;
  }

  return ref;
}