Skip to content

Commit e1de3dc

Browse files
committed
Fix typing issue with AsyncStorage configuration
1 parent e15a63d commit e1de3dc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Diff for: trackers/react-native-tracker/src/event_store.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { EventStore, EventStorePayload, newInMemoryEventStore } from '@snowplow/tracker-core';
2-
import { AsyncStorage, EventStoreConfiguration, TrackerConfiguration } from './types';
3-
4-
type Configuration = Omit<EventStoreConfiguration, 'asyncStorage'> &
5-
TrackerConfiguration & { asyncStorage: AsyncStorage };
2+
import { EventStoreConfiguration, TrackerConfiguration } from './types';
3+
import DefaultAsyncStorage from '@react-native-async-storage/async-storage';
64

75
export async function newReactNativeEventStore({
86
namespace,
97
maxEventStoreSize = 1000,
108
useAsyncStorageForEventStore: useAsyncStorage = true,
11-
asyncStorage,
12-
}: Configuration): Promise<EventStore> {
9+
asyncStorage = DefaultAsyncStorage,
10+
}: TrackerConfiguration & EventStoreConfiguration): Promise<EventStore> {
1311
const queueName = `snowplow_${namespace}`;
1412

1513
async function newInMemoryEventStoreForReactNative() {

0 commit comments

Comments
 (0)