Skip to main content

StateObserver.jsonlines()

BFChainPluginStateObserverjsonlinesLess than 1 minute

Implemented the Generator method that monitors the state changes of the plug-in;

StateObserver.jsonlines()

参数

  • none

返回值

an iterator
The return value of each iteration is an object that implements part of the State interface;

Example

import { statusBarPlugin } from "@plaoc/plugins";
statusBarPlugin.state.onChange(state => {
  // Executed when the state of the system status bar changes
})
(async () => {
  for await (const _info of StatusBarPlugin.state.jsonlines()) {
    // status data can be obtained here
    // You can also implement monitoring through the StateObserver.onChange(listener) method
    // console. log("stateChange", _info);
  }
})();

Platform Compatibility

Property/Method/EventAndroidIOSDesktop-DevDesktop
jsonlinesX

StateObserver

Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v2.15.7