mgpuOwnDeviceLost function

Future<void>? mgpuOwnDeviceLost(
  1. JSObject device
)

The loss promise belonging to minigpu's owned device, if readable.

Implementation

Future<void>? mgpuOwnDeviceLost(JSObject device) {
  try {
    final promise = device.getProperty<JSPromise<JSAny?>?>('lost'.toJS);
    if (promise == null) return null;
    return promise.toDart.then((_) {});
  } catch (_) {
    return null;
  }
}