Converts a resource reference into a promise that resolves when loading completes, or rejects if the resource errors.
This is useful when you need to compose resource loading with promise-based workflows.
This demo uses fake resources backed by signals and delayed with setTimeout. Run both success and error cases to see how resourceRefToPromise behaves.