Add "setJsBundlesDirectory" method to CatalystInstanceImpl

Differential Revision: D6042493

fbshipit-source-id: 950c6d6bdc2e0b62b14c9bcfc86233159a002c67
This commit is contained in:
Alex Dvornikov
2017-11-01 06:33:37 -07:00
committed by Facebook Github Bot
parent 21917ab7bf
commit b5651d945c
8 changed files with 42 additions and 24 deletions

View File

@@ -10,7 +10,6 @@
package com.facebook.react.bridge;
import android.content.Context;
import com.facebook.react.common.DebugServerException;
/**
@@ -98,7 +97,20 @@ public abstract class JSBundleLoader {
}
/**
* Loads the script, returning the URL of the source it loaded.
* This loader is used to wrap other loaders and set js bundles directory before executing
* application script.
*/
public static JSBundleLoader createSplitBundlesLoader(
final String jsBundlesDirectory, final JSBundleLoader delegate) {
return new JSBundleLoader() {
@Override
public String loadScript(CatalystInstanceImpl instance) {
instance.setJsBundlesDirectory(jsBundlesDirectory);
return delegate.loadScript(instance);
}
};
}
/** Loads the script, returning the URL of the source it loaded. */
public abstract String loadScript(CatalystInstanceImpl instance);
}