MCPcopy
hub / github.com/buildbot/buildbot / useDataApiSingleElementQuery

Function useDataApiSingleElementQuery

www/data-module/src/data/ReactUtils.ts:121–125  ·  view source on GitHub ↗
(
    el: T | null, dependencies: any[], callback: (el: T) => DataCollection<U>)

Source from the content-addressed store, hash-verified

119}
120
121export function useDataApiSingleElementQuery<T extends BaseClass, U extends BaseClass>(
122 el: T | null, dependencies: any[], callback: (el: T) => DataCollection<U>): DataCollection<U> {
123 return useDataApiDynamicQuery([el === null, ...dependencies],
124 () => el === null ? new DataCollection<U>() : callback(el));
125}
126
127export function useDataApiSinglePropertiesQuery<T extends BaseClass>(
128 el: T | null, dependencies: any[], callback: (el: T) => DataPropertiesCollection): DataPropertiesCollection {

Calls 1

useDataApiDynamicQueryFunction · 0.85

Tested by

no test coverage detected