Update index.js

This commit is contained in:
Michael Diarmid 2018-01-17 15:21:21 +00:00 committed by GitHub
parent 06424aff14
commit f320d9243a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 24 deletions

View File

@ -340,30 +340,6 @@ export function nativeToJSError(code: string, message: string, additionalProps?:
return error;
}
/**
* TODO is this needed?
* Prepends appName arg to all native method calls
* @param appName
* @param NativeModule
*/
export function nativeWithApp(appName: string, NativeModule: Object) {
const native = {};
const methods = Object.keys(NativeModule);
for (let i = 0, len = methods.length; i < len; i++) {
const method = methods[i];
if (isFunction(NativeModule[method])) {
native[method] = (...args) => {
return NativeModule[method](...[appName, ...args]);
};
} else {
native[method] = NativeModule[method];
}
}
return native;
}
/**
*
* @param object