From 09752846e59075c3c0204b123596e12b970592ac Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Mon, 2 Nov 2015 23:05:06 -0800 Subject: [PATCH] Update example apps with new schema API --- examples/ReactExample/components/realm.js | 16 ++++++++-------- examples/ReactExample/components/todo-app.js | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/ReactExample/components/realm.js b/examples/ReactExample/components/realm.js index 7ab84d75..d3f44bed 100644 --- a/examples/ReactExample/components/realm.js +++ b/examples/ReactExample/components/realm.js @@ -10,17 +10,17 @@ module.exports = new Realm({ schema: [ { name: 'Todo', - properties: [ - {name: 'done', type: Realm.Types.BOOL, default: false}, - {name: 'text', type: Realm.Types.STRING, default: ''}, - ] + properties: { + done: {type: Realm.Types.BOOL, default: false}, + text: Realm.Types.STRING, + }, }, { name: 'TodoList', - properties: [ - {name: 'name', type: Realm.Types.STRING}, - {name: 'items', type: Realm.Types.LIST, objectType: 'Todo'}, - ] + properties: { + name: Realm.Types.STRING, + items: {type: Realm.Types.LIST, objectType: 'Todo', default: []}, + }, }, ], }); diff --git a/examples/ReactExample/components/todo-app.js b/examples/ReactExample/components/todo-app.js index fc7174cb..eb4f6ee1 100644 --- a/examples/ReactExample/components/todo-app.js +++ b/examples/ReactExample/components/todo-app.js @@ -19,7 +19,7 @@ class TodoApp extends React.Component { let todoLists = realm.objects('TodoList'); if (todoLists.length < 1) { realm.write(() => { - realm.create('TodoList', {name: 'Todo List', items: []}); + realm.create('TodoList', {name: 'Todo List'}); }); } @@ -78,7 +78,7 @@ class TodoApp extends React.Component { } realm.write(() => { - realm.create('TodoList', {name: '', items: []}); + realm.create('TodoList', {name: ''}); }); this._setEditingRow(items.length - 1);