MCPcopy Create free account
hub / github.com/freecodexyz/free-code / onPluginsAutoUpdated

Function onPluginsAutoUpdated

src/utils/plugins/pluginAutoupdate.ts:51–65  ·  view source on GitHub ↗
(
  callback: PluginAutoUpdateCallback,
)

Source from the content-addressed store, hash-verified

49 * the callback will be invoked immediately with the pending updates.
50 */
51export function onPluginsAutoUpdated(
52 callback: PluginAutoUpdateCallback,
53): () => void {
54 pluginUpdateCallback = callback
55
56 // If there are pending updates that happened before registration, deliver them now
57 if (pendingNotification !== null && pendingNotification.length > 0) {
58 callback(pendingNotification)
59 pendingNotification = null
60 }
61
62 return () => {
63 pluginUpdateCallback = null
64 }
65}
66
67/**
68 * Check if pending updates came from autoupdate (for notification purposes).

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected