react-native-reanimated
Version:
More powerful alternative to Animated library for React Native.
28 lines (23 loc) • 756 B
JavaScript
/* eslint-disable reanimated/use-reanimated-error */
;
import { RuntimeKind } from 'react-native-worklets';
function ReanimatedErrorConstructor(message) {
'worklet';
const prefix = '[Reanimated]';
const errorInstance = new Error(message ? `${prefix} ${message}` : prefix);
errorInstance.name = 'ReanimatedError';
return errorInstance;
}
/**
* Registers ReanimatedError in the global scope. Register only for Worklet
* runtimes.
*/
export function registerReanimatedError() {
'worklet';
if (globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) {
globalThis.ReanimatedError = ReanimatedErrorConstructor;
}
}
export const ReanimatedError = ReanimatedErrorConstructor;
// signed type
//# sourceMappingURL=errors.js.map