MCPcopy Index your code
hub / github.com/atomicdata-dev/atomic-data-browser / useString

Function useString

react/src/hooks.ts:332–342  ·  view source on GitHub ↗
(
  resource: Resource,
  propertyURL: string,
  opts?: useValueOptions,
)

Source from the content-addressed store, hash-verified

330 * React component. See {@link useValue}
331 */
332export function useString(
333 resource: Resource,
334 propertyURL: string,
335 opts?: useValueOptions,
336): [string | null, (string: string) => Promise<void>] {
337 const [val, setVal] = useValue(resource, propertyURL, opts);
338 if (val == null) {
339 return [null, setVal];
340 }
341 return [valToString(val), setVal];
342}
343
344/**
345 * Returns the most fitting title / name for a Resource. This is either the

Callers 15

MetaSetterFunction · 0.90
ParentFunction · 0.90
NestedParentFunction · 0.90
NewIntanceButtonFunction · 0.90
WebMonetizationWrapperFunction · 0.90
ClassDetailFunction · 0.90
InputResourceFunction · 0.90
InputMarkdownFunction · 0.90
InputStringFunction · 0.90
ResourceFormFunction · 0.90
NewFunction · 0.90

Calls 2

valToStringFunction · 0.90
useValueFunction · 0.85

Tested by

no test coverage detected