I am using the Realm.io database in a React Native application. I have a simple write command:
Realm.write(() => {
Realm.create('Dog', { name: 'Bob'}, true);
});
If a write operation for some reason takes more than a couple of milliseconds, how can I make sure that when I ask Bob for a dog, I will get an updated object?
Is there a way for a write operation to return a promise or something similar so that I can only execute the code after the write operation succeeds?
source
share