watchThirdPartyPluginApi<TApi>
Watches a third-party plugin’s API and returns a live ThirdPartyPluginApiRef.
The ref re-reads on every app.plugins changed and every library lifecycle broadcast, so it follows the plugin through enable, disable, update and reload with no polling. This is the shape of an OPTIONAL dependency: read ref.value where the integration is used, and treat null as “not there”.
Import:
import { watchThirdPartyPluginApi } from '@mnaoumov/obsidian-lib/plugin/third-party-plugin';Signature:
function watchThirdPartyPluginApi(params: WatchThirdPartyPluginApiParams<TApi>): ThirdPartyPluginApiRef<TApi>Parameters:
| Parameter | Type | Description |
|---|---|---|
params |
WatchThirdPartyPluginApiParams<TApi> | The WatchThirdPartyPluginApiParams. |
Returns: ThirdPartyPluginApiRef<TApi> — The live reference.
Links to this page: