( resource: Resource, propertyURL: string, opts?: useValueOptions, )
| 330 | * React component. See {@link useValue} |
| 331 | */ |
| 332 | export 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 |
no test coverage detected