Tauri onUpdaterEvent

2024-02-05 17:48 更新
onUpdaterEvent(: ): Promise<UnlistenFnhandlerfn>

偵聽更新程序事件。

import { onUpdaterEvent } from "@tauri-apps/api/updater";
const unlisten = await onUpdaterEvent(({ error, status }) => {
console.log('Updater event', error, status);
});

// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
unlisten();

Since: 1.0.2

參數(shù)

名字類型
handler(statusUpdateStatusResult) => void

Returns: Promise<UnlistenFn>

解析為函數(shù)以取消偵聽事件的承諾。 請注意,如果您的偵聽器超出范圍(例如,組件已卸載),則需要刪除偵聽器。


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號