Created
December 29, 2020 18:14
-
-
Save mbvissers/b98c2165a283135b35ffb87536f8cb82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Realm from "realm"; | |
// Declare Schema | |
class BookSchema extends Realm.Object {} | |
BookSchema.schema = { | |
name: 'Book', | |
properties: { | |
title: 'string', | |
pages: 'int', | |
edition: 'int?' | |
} | |
}; | |
// Create realm | |
let realm = new Realm({schema: [BookSchema], schemaVersion: 1}); | |
// Export the realm | |
export default realm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment