()
| 424 | |
| 425 | // We have to remove getters from the resource function so we wrap it |
| 426 | function getData() { |
| 427 | const currentCollection = collection() |
| 428 | if (currentCollection) { |
| 429 | const config: CollectionConfigSingleRowOption<any, any, any> = |
| 430 | currentCollection.config |
| 431 | if (config.singleResult) { |
| 432 | // Force resource tracking so Suspense works |
| 433 | getDataResource() |
| 434 | return data[0] |
| 435 | } |
| 436 | } |
| 437 | return getDataResource() |
| 438 | } |
| 439 | |
| 440 | Object.defineProperties(getData, { |
| 441 | data: { |