How to use the @aws-amplify/cache.setItem function in @aws-amplify/cache

To help you get started, we’ve selected a few @aws-amplify/cache examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-amplify / amplify-js / packages / analytics / src / Providers / AWSPinpointProvider.ts View on Github external
private async _getEndpointId(cacheKey) {
		// try to get from cache
		let endpointId = await Cache.getItem(cacheKey);
		logger.debug(
			'endpointId from cache',
			endpointId,
			'type',
			typeof endpointId
		);
		if (!endpointId) {
			endpointId = uuid();
			Cache.setItem(cacheKey, endpointId);
		}
		return endpointId;
	}

@aws-amplify/cache

Cache category of aws-amplify

Apache-2.0
Latest version published 7 months ago

Package Health Score

91 / 100
Full package analysis

Similar packages