MCPcopy Create free account
hub / github.com/atomicdata-dev/atomic-data-browser / useNumber

Function useNumber

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

Source from the content-addressed store, hash-verified

396
397/** See {@link useValue} */
398export function useNumber(
399 resource: Resource,
400 propertyURL: string,
401 opts?: useValueOptions,
402): [number | null, setValue] {
403 const [value, set] = useValue(resource, propertyURL, opts);
404 if (value == null) {
405 return [NaN, set];
406 }
407 return [valToNumber(value), set];
408}
409
410/** Returns false if there is no value for this propertyURL. See {@link useValue} */
411export function useBoolean(

Callers 4

InputNumberFunction · 0.90
FileInnerFunction · 0.90
CollectionFunction · 0.90
InvitePageFunction · 0.90

Calls 2

valToNumberFunction · 0.90
useValueFunction · 0.85

Tested by

no test coverage detected