According to https://facebook.github.io/react-native/docs/native-modules-android.html native android modules extends ReactContextBaseJavaModule , Is the module singleton?
If I have the following method
@ReactMethod
public void testMethod(String message, Promise promise) {
this.promise = promise;
}
and
MyModule.testMethod('A').then(function(result){
console.log(result);
});
MyModule.testMethod('B').then(function(result){
console.log(result);
});
MyModule.testMethod('C').then(function(result){
console.log(result);
});
What happens exactly? is MyModule.testMethod('C') overwrite this.promise (the module is singleton ) OR each time the new instance of module is created and promise is a property and isolated?
According to https://facebook.github.io/react-native/docs/native-modules-android.html native android modules
extends ReactContextBaseJavaModule, Is the module singleton?If I have the following method
and
What happens exactly? is
MyModule.testMethod('C')overwritethis.promise(the module is singleton ) OR each time the new instance of module is created andpromiseis a property and isolated?