From 2e3dbe926180520b99727f4612aa331a58998bf8 Mon Sep 17 00:00:00 2001 From: Corentin Andre Date: Wed, 18 Sep 2024 11:52:23 +0200 Subject: [PATCH] feat: allow codesplitting mock file --- package/src/MMKV.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/package/src/MMKV.ts b/package/src/MMKV.ts index a4fa00ca..cae55fb6 100644 --- a/package/src/MMKV.ts +++ b/package/src/MMKV.ts @@ -1,5 +1,3 @@ -import { createMMKV } from './createMMKV'; -import { createMockMMKV } from './createMMKV.mock'; import { isTest } from './PlatformChecker'; import type { Configuration } from './NativeMmkv'; import type { Listener, MMKVInterface, NativeMMKV } from './Types'; @@ -22,8 +20,8 @@ export class MMKV implements MMKVInterface { constructor(configuration: Configuration = { id: 'mmkv.default' }) { this.id = configuration.id; this.nativeInstance = isTest() - ? createMockMMKV() - : createMMKV(configuration); + ? require('./createMMKV.mock').createMockMMKV() + : require('./createMMKV').createMMKV(configuration); this.functionCache = {}; addMemoryWarningListener(this);