Add comments to explain checking for userAgent

This commit is contained in:
Scott Kyle 2016-01-08 15:54:30 -08:00
parent 334e646d7b
commit 7202994482
1 changed files with 2 additions and 0 deletions

View File

@ -5,8 +5,10 @@
'use strict';
if (typeof Realm != 'undefined') {
// The global Realm constructor should be available on device (using JavaScriptCore).
module.exports = Realm; // eslint-disable-line no-undef
} else if (navigator.userAgent) {
// The userAgent will be defined when running in a browser (such as Chrome debugging mode).
module.exports = require('./realm');
} else {
throw new Error('Missing Realm constructor - please ensure RealmReact framework is included!');