UNPKG

react-native-gigya-sdk

Version:
24 lines (22 loc) 649 B
import { NativeModules } from 'react-native'; const { GigyaSdk } = NativeModules; import handleSdkCall from '../internals/handleSdkCall'; export default function (apiEndPoint, params) { return new Promise(async (resolve, reject) => { const values = params || {}; try { for (let key in values) { if (typeof values[key] === 'object') { values[key] = JSON.stringify(values[key]); } } const response = await handleSdkCall(GigyaSdk.sendApiCall(apiEndPoint, JSON.stringify(values))); resolve(response); } catch (e) { reject(e); } }); } //# sourceMappingURL=sendApiCall.js.map