discard method

Future<Tab?> discard(
  1. int? tabId
)

Discards a tab from memory. Discarded tabs are still visible on the tab strip and are reloaded when activated. tabId The ID of the tab to be discarded. If specified, the tab is discarded unless it is active or already discarded. If omitted, the browser discards the least important tab. This can fail if no discardable tabs exist. returns Called after the operation is completed.

Implementation

Future<Tab?> discard(int? tabId) async {
  var $res = await promiseToFuture<$js.Tab?>($js.chrome.tabs.discard(tabId));
  return $res?.let(Tab.fromJS);
}