We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b85c71a commit 11f0aa3Copy full SHA for 11f0aa3
1 file changed
packages/react-native-quick-crypto/src/ec.ts
@@ -35,8 +35,13 @@ import { Buffer } from '@craftzdog/react-native-buffer';
35
import { ECDH } from './ecdh';
36
37
class EcUtils {
38
- private static native =
39
- NitroModules.createHybridObject<EcKeyPair>('EcKeyPair');
+ private static _native: EcKeyPair | undefined;
+ private static get native(): EcKeyPair {
40
+ if (!this._native) {
41
+ this._native = NitroModules.createHybridObject<EcKeyPair>('EcKeyPair');
42
+ }
43
+ return this._native;
44
45
public static getSupportedCurves(): string[] {
46
return this.native.getSupportedCurves();
47
}
0 commit comments