-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
Ran CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.A question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
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?
Metadata
Metadata
Assignees
Labels
Ran CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.A question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.