Spencer Ahrens c88a1cd9b8 Updates from Wed Feb 18
- [reactnative] s/SpinnerIOS/ActivityIndicatorIOS/ | Dan Witte
- [react-packager] Add a non-persistent mode for static builds | Amjad Masad
- [React Native] Fix stored file rejection when initializing cache | Alex Akers
- [React Native] Consolidate network requests in image downloader | Alex Akers
- [React Native] Update RCTCache | Alex Akers
- Converted all low-hanging RKBridgeModules in FBReactKit to RCTBridgeModules | Nick Lockwood
2015-02-18 17:51:14 -08:00

40 lines
936 B
JavaScript

'use strict';
var Activity = require('./src/Activity');
var Server = require('./src/Server');
exports.middleware = function(options) {
var server = new Server(options);
return server.processRequest.bind(server);
};
exports.buildPackageFromUrl = function(options, reqUrl) {
Activity.disable();
// Don't start the filewatcher or the cache.
if (options.nonPersistent == null) {
options.nonPersistent = true;
}
var server = new Server(options);
return server.buildPackageFromUrl(reqUrl)
.then(function(p) {
server.end();
return p;
});
};
exports.getDependencies = function(options, main) {
Activity.disable();
// Don't start the filewatcher or the cache.
if (options.nonPersistent == null) {
options.nonPersistent = true;
}
var server = new Server(options);
return server.getDependencies(main)
.then(function(r) {
server.end();
return r.dependencies;
});
};