react-meteor-data has the useful hook useFind but that’s only for lists/cursors, but findOne is a single doc.
But the README doesn’t mention how to do a findOne operation. Currently I’m doing the below. I subscribe, check if the subscription loaded, then run findOne, check if the doc exists, then render the doc info.
const { id } = useParams();
const isLoading = useSubscribe(`someSub`);
if (isLoading()) { return <div>Loading...</div>; }
const doc = SomeCollection.findOne(id);
if (!doc) { return <div>Document not found</div>; }
// render doc info
Is this the correct pattern or should I be doing something else?