You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use realm on the server using Node and in React Native. On the server this issue doesn't happen, it is only in React native
Goals
Attach a listener to an object subscription
Expected Results
The listener is attached.
Actual Results
subscription.addListener is not a function. It does return an object, but it doesn't have any of the methods in the docs. The objects are subscribed to ok.
Steps to Reproduce
Try and add a listener to a object subscription in React Native
Code Sample
I'm actually using the listener function from your tests but the same thing happens using vanilla.
subscribe (results) {
const subscription = results.subscribe()
return new Promise((resolve, reject) => {
subscription.addListener((subscription, state) => {
if (state === Realm.Sync.SubscriptionState.Complete) {
resolve()
}
else if (state === Realm.Sync.SubscriptionState.Error) {
reject()
}
})
setTimeout(() => reject('listener never called'), 5000)
})
}
let objs = realm.objects('User');
await subscribe(objs);
Normal example
let objs = realm.objects('User');
let sub = objs.subscribe();
sub.addListener((subscription, state) => {
...
})
Version of Realm and Tooling
Realm JS SDK Version: 2.8.3
Node or React Native: 0.55.4
Client OS & Version:
Which debugger for React Native: Chrome
The text was updated successfully, but these errors were encountered:
let objs = realm.objects('User');
let sub = objs.subscribe();
// here typeof sub.addListener === 'undefined'
sub.addListener((subscription, state) => {
...
})
Background
I use realm on the server using Node and in React Native. On the server this issue doesn't happen, it is only in React native
Goals
Attach a listener to an object subscription
Expected Results
The listener is attached.
Actual Results
subscription.addListener is not a function. It does return an object, but it doesn't have any of the methods in the docs. The objects are subscribed to ok.
Steps to Reproduce
Try and add a listener to a object subscription in React Native
Code Sample
I'm actually using the listener function from your tests but the same thing happens using vanilla.
Normal example
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: