-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get data #7
Comments
Since it caused by detaching |
I also have update issue name with a more meaning description! |
Sorry that i have to reopen this issue, but i just noticed, that i still cannot get the data with .data(). But unter the object are a lot of element (under _data)! |
Hi @apppro123, have you try to use ‘onLoaded’? Here is an example #5 (comment) |
Now it is working! Is this because the db is not loaded after app starts (i want to access data() in componentDidMount()) ? |
Raw data is loaded before the app started. It will be serialised after the app started, then become available to use. On your componentDidMount(), you can use ‘.data()’ within ‘.onLoaded’ callback. I didn’t get what you mean by ‘showing data in the object’. Can you explain a bit more? Thanks! |
With that i mean if i make console.log(Calendar) it shows all properties and under _data i can the calendar-Objects in an array. But with console.log(Calendar.data()) it just gives a empty array. |
If you use .data() inside onLoaded event, does it still show an empty result? Use .data() will ensure data is properly serialised correctly. |
Inside the onLoaded it is working correctly. But it is strange that data() doesnt work without onLoaded but if i just show the object (console.log(Calendar)) there under _data it shows the right array and that is also without onLoaded!? |
The reason So it is safe to use I would recommend you to use |
var TodoSchema = {
name: "Todos",
props: {
name: "string",
note: "?string",
completed: "boolean"
},
};
At the moment i cannot perform for example
Todos.data() or Todos.get({ name: "Setup database for React Native" }) or Todos.remove() doesnt work!!
it runs when i want to get Todos._data, but i just get an empty list but when i just want to get Todos i see under the object, that there should be 7 items in the list
and also Todos.available is false but in the object Todos it is true!?
The text was updated successfully, but these errors were encountered: