2015-10-28 10:37:17 -07:00
|
|
|
/* Copyright 2015 Realm Inc - All Rights Reserved
|
|
|
|
* Proprietary and Confidential
|
|
|
|
*/
|
|
|
|
|
2015-10-01 22:56:47 -07:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
if (typeof Realm != 'undefined') {
|
2016-01-08 15:54:30 -08:00
|
|
|
// The global Realm constructor should be available on device (using JavaScriptCore).
|
2015-10-01 22:56:47 -07:00
|
|
|
module.exports = Realm; // eslint-disable-line no-undef
|
2016-01-07 15:18:27 -08:00
|
|
|
} else if (navigator.userAgent) {
|
2016-01-08 15:54:30 -08:00
|
|
|
// The userAgent will be defined when running in a browser (such as Chrome debugging mode).
|
2015-10-06 13:36:56 -06:00
|
|
|
module.exports = require('./realm');
|
2016-01-07 15:18:27 -08:00
|
|
|
} else {
|
|
|
|
throw new Error('Missing Realm constructor - please ensure RealmReact framework is included!');
|
2015-10-01 22:56:47 -07:00
|
|
|
}
|