( resource: Resource, propertyURL: string, opts?: useValueOptions, )
| 425 | * component. See {@link useValue} |
| 426 | */ |
| 427 | export function useDate( |
| 428 | resource: Resource, |
| 429 | propertyURL: string, |
| 430 | opts?: useValueOptions, |
| 431 | ): Date | null { |
| 432 | const store = useStore(); |
| 433 | const [value] = useValue(resource, propertyURL, opts); |
| 434 | if (value == null) { |
| 435 | return null; |
| 436 | } |
| 437 | try { |
| 438 | return valToDate(value); |
| 439 | } catch (e) { |
| 440 | store.handleError(e); |
| 441 | return null; |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | /** Preffered way of using the store in a Component or Hook */ |
| 446 | export function useStore(): Store { |
nothing calls this directly
no test coverage detected