Decouple module callback mechanism from CatalystInstance

Summary:
Create a JSInstance superinterface which doesn't include all
the lifecycle stuff.

Reviewed By: AaaChiuuu

Differential Revision: D4614410

fbshipit-source-id: 16047bbcb1bb69bf36a0a13ef68f3a6aa396a991
This commit is contained in:
Marc Horowitz
2017-03-14 15:28:52 -07:00
committed by Facebook Github Bot
parent 7e4b8ff000
commit 6410e256c5
8 changed files with 74 additions and 45 deletions

View File

@@ -23,7 +23,8 @@ import com.facebook.react.common.annotations.VisibleForTesting;
* Java APIs be invokable from JavaScript as well.
*/
@DoNotStrip
public interface CatalystInstance extends MemoryPressureListener {
public interface CatalystInstance
extends MemoryPressureListener, JSInstance {
void runJSBundle();
/**
@@ -34,8 +35,11 @@ public interface CatalystInstance extends MemoryPressureListener {
// This is called from java code, so it won't be stripped anyway, but proguard will rename it,
// which this prevents.
@DoNotStrip
void invokeCallback(ExecutorToken executorToken, final int callbackID, final NativeArray arguments);
@Override @DoNotStrip
void invokeCallback(
ExecutorToken executorToken,
int callbackID,
NativeArray arguments);
@DoNotStrip
void callFunction(
ExecutorToken executorToken,