mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-02 06:45:02 +08:00
Add "setJsBundlesDirectory" method to CatalystInstanceImpl
Differential Revision: D6042493 fbshipit-source-id: 950c6d6bdc2e0b62b14c9bcfc86233159a002c67
This commit is contained in:
committed by
Facebook Github Bot
parent
21917ab7bf
commit
b5651d945c
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user