react-native-crash-handler
Version:
A ReactNatice Crash Handler for android, not ios
26 lines (22 loc) • 805 B
JavaScript
import { NativeModules } from 'react-native';
const { RNCrashHandler } = NativeModules;
export const Crash = {
putCurrentCharacterState(characterState) {
if (typeof characterState !== "object") {
throw new Error("characterState must project")
}
if (characterState.Name === undefined) {
throw new Error("characterState must have Name")
}
RNCrashHandler.putCurrentCharacterState(characterState)
},
putCurrentScenesState(scenesState) {
if (typeof scenesState !== "object") {
throw new Error("ScenesState must project")
}
if (scenesState.Name === undefined) {
throw new Error("ScenesState must have Name")
}
RNCrashHandler.putCurrentScenesState(scenesState)
}
}