[utils] Allow _native to return statics
This commit is contained in:
parent
fb8c08c7f6
commit
e452f514a3
|
@ -351,9 +351,13 @@ export function nativeWithApp(appName: string, NativeModule: Object) {
|
||||||
|
|
||||||
for (let i = 0, len = methods.length; i < len; i++) {
|
for (let i = 0, len = methods.length; i < len; i++) {
|
||||||
const method = methods[i];
|
const method = methods[i];
|
||||||
|
if (isFunction(NativeModule[method])) {
|
||||||
native[method] = (...args) => {
|
native[method] = (...args) => {
|
||||||
return NativeModule[method](...[appName, ...args]);
|
return NativeModule[method](...[appName, ...args]);
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
native[method] = NativeModule[method];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return native;
|
return native;
|
||||||
|
|
Loading…
Reference in New Issue