toJSPromiseOrValue property

JSAny? get toJSPromiseOrValue

Converts this value to a JSPromise or a synchronous value.

If this is a Future, it's converted to a JSPromise. Otherwise, it returns this as-is.

Implementation

JSAny? get toJSPromiseOrValue => switch (this) {
  Future<T> future => future.toJS,
  _ => this as JSAny?,
};