1 1
import { browserOrNode, isWebWorker } from '@aws-amplify/core';
2
import { Adapter } from '..';
3

4 1
const getDefaultAdapter: () => Adapter = () => {
5 1
	const { isBrowser } = browserOrNode();
6

7 1
	if ((isBrowser && window.indexedDB) || (isWebWorker() && self.indexedDB)) {
8 1
		return require('../IndexedDBAdapter').default;
9
	}
10

11 0
	const { AsyncStorageAdapter } = require('../AsyncStorageAdapter');
12

13 0
	return new AsyncStorageAdapter();
14
};
15

16 1
export default getDefaultAdapter;

Read our documentation on viewing source code .

Loading