@wordpress/widget-dashboard
Version:
Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.
23 lines (22 loc) • 897 B
JavaScript
;
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
let _wordpress_compose = require("@wordpress/compose");
let ___context_dashboard_context_tsx = require("../context/dashboard-context.cjs");
// packages/widget-dashboard/src/hooks/use-runtime-actions.ts
const NO_RUNTIME_ACTIONS = [];
/**
* The runtime actions of one instance: what its first mounted render
* declares, so a copy of the tile never takes them over.
*
* @param {string} uuid The instance.
*/
function useRuntimeActions(uuid) {
const { runtimeActions } = (0, ___context_dashboard_context_tsx.useDashboardInternalContext)();
const [first] = (0, _wordpress_compose.useObservableValue)(runtimeActions, uuid)?.values() ?? [];
return first ?? NO_RUNTIME_ACTIONS;
}
exports.useRuntimeActions = useRuntimeActions;
//# sourceMappingURL=use-runtime-actions.cjs.map