mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-11 14:54:33 +00:00
Merge pull request #269 from realm/al-example-class
Use classes in the example
This commit is contained in:
commit
4c965fd09c
@ -6,21 +6,20 @@
|
||||
|
||||
import Realm from 'realm';
|
||||
|
||||
export default new Realm({
|
||||
schema: [
|
||||
{
|
||||
class Todo {}
|
||||
Todo.schema = {
|
||||
name: 'Todo',
|
||||
properties: {
|
||||
done: {type: Realm.Types.BOOL, default: false},
|
||||
text: Realm.Types.STRING,
|
||||
},
|
||||
},
|
||||
{
|
||||
};
|
||||
class TodoList {}
|
||||
TodoList.schema = {
|
||||
name: 'TodoList',
|
||||
properties: {
|
||||
name: Realm.Types.STRING,
|
||||
items: {type: Realm.Types.LIST, objectType: 'Todo', default: []},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
};
|
||||
export default new Realm({schema: [Todo, TodoList]});
|
||||
|
Loading…
x
Reference in New Issue
Block a user