Firebase once() timeout
问题 I am using Firebase once() method to retrieve a value in a React Native mobile app. Trouble is if the phone is offline, once() never returns. Documentation says that ref.off() method should cancel callbacks, but that doesn't seem to work. I'm guessing that off() doesn't apply to once() callbacks. If so how would I create a timeout? 回答1: There's no such concept as a timeout when dealing with Firebase Realtime Database APIs on any platform. Clients are generally not expected to know or care if