Is it necessary to 'await' the response of Analytics logEvent function? #4572
-
I've seen in the analytics usage documentation (https://rnfirebase.io/analytics/usage) that the sample code to log an event "awaits" the logEvent function:
Is it necessary to call the logEvent function synchronously? What are the tradeoffs of not awaiting the result of this function? I want to call this function in the background since I don't want my app's flow to depend on the analytics system. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Quite a good question - I don't think it matters at all - it doesn't even return anything! (I just checked) I've never seen those API calls throw in practice though. Maybe worth a careful attempt? |
Beta Was this translation helpful? Give feedback.
@cenobyte321 since the logEvent doesn't return data you don't even need the
.then
you can simply doHere is a very minimal way to write it