UNPKG

@asteriskzuo/react-native-easemob

Version:
21 lines (17 loc) 494 B
/** * Call native api */ import { ChatError } from '../common/ChatError'; import { NativeModules } from 'react-native'; const { ExtSdkApiRN } = NativeModules; console.log('ExtSdkApiRN: ', ExtSdkApiRN); export class Native { protected static hasErrorFromResult(result: any): void { if (result?.error) { throw new ChatError(result.error); } } protected static _callMethod<T>(method: string, args?: {}): Promise<T> { return ExtSdkApiRN.callMethod(method, args); } }