react-native-config-jsi
Version:
⚡️ Fast JSI-based library to access .env variables natively with C++ performance.
22 lines (20 loc) • 681 B
JavaScript
;
import { NativeModules } from 'react-native';
let _getValue = global.getValue;
// Автоинициализация
if (!_getValue) {
if (NativeModules.ReactNativeConfigJsi?.install) {
NativeModules.ReactNativeConfigJsi.install(); // Вызываем native install метод
_getValue = global.getValue; // Сохраняем глобальную ссылку на объект SqlDb
console.log('react-native-config initialized successfully');
}
}
export const RNConfig = {
get: key => {
if (typeof key !== 'string') {
throw new Error('Key must be a string');
}
return _getValue(key);
}
};
//# sourceMappingURL=index.js.map