MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / registerView

Function registerView

web/pgadmin/static/js/SchemaView/registry.js:15–31  ·  view source on GitHub ↗
(viewFunc, name)

Source from the content-addressed store, hash-verified

13const _views = {};
14
15export function registerView(viewFunc, name) {
16 name = name || viewFunc.name;
17
18 if (name in _views) {
19 throw new Error(
20 `View type '${name}' is alredy registered.`
21 );
22 }
23
24 if (typeof viewFunc !== 'function') {
25 throw new Error(
26 `View '${name}' must be a function.`
27 );
28 }
29
30 _views[name] = viewFunc;
31}
32
33export function View(name) {
34 const view = _views[name];

Callers 5

FormView.jsxFile · 0.90
SchemaView.jsxFile · 0.90
FieldSetView.jsxFile · 0.90
InlineView.jsxFile · 0.90
grid.jsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected