Open TomasGranda opened 2 months ago
Hi, i'm trying to use the Observer this way:
var observable = GetFirebaseClient() .Child("rooms") .Child(playerID) .AsObservable<string[]>() .Subscribe(players => { Debug.Log(players.Object); }, ex => { Debug.LogError(ex); });
but the observer never runs the first callback.
When i use the observer this way:
var observable = GetFirebaseClient() .Child("rooms") .Child(playerID) .AsObservable<object>() .Subscribe(players => { Debug.Log(players.Object); }, ex => { Debug.LogError(ex); });
it works and print this:
As expected. I don't know if this is a bug or i'm using the observer wrong.
Edit:
i fix it using this code:
GetFirebaseClient() .Child("rooms") .OrderByKey() .StartAt(playerID) .AsObservable<object>() .Subscribe(players => { Debug.Log(players.Object); }, ex => Debug.LogError(ex), () => Debug.Log("Completed"));
using OrderByKey and StartAt
Apparently my issue is that i get 2 updates. 1 when i suscribe for nothing and 1 when i modify the node i'm observing. I don't know why i'm getting 2 updates but ok
Hi, i'm trying to use the Observer this way:
but the observer never runs the first callback.
When i use the observer this way:
it works and print this:
As expected. I don't know if this is a bug or i'm using the observer wrong.
Edit:
i fix it using this code:
using OrderByKey and StartAt