How to use the @aws-amplify/core.Hub.dispatch function in @aws-amplify/core

To help you get started, we’ve selected a few @aws-amplify/core 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 / storage / src / Providers / AWSS3Provider.ts View on Github external
const dispatchStorageEvent = (track, attrs, metrics) => {
    if (track) {
        Hub.dispatch('storage', { attrs, metrics }, 'Storage');
    }
};
github aws-amplify / amplify-js / packages / auth / src / OAuth / OAuth.ts View on Github external
const dispatchAuthEvent = (event: string, data: any, message: string) => {
	Hub.dispatch('auth', { event, data, message }, 'Auth', AMPLIFY_SYMBOL);
};
github aws-amplify / amplify-js / packages / analytics / src / Analytics.ts View on Github external
const dispatchAnalyticsEvent = (event: string, data: any, message: string) => {
	Hub.dispatch(
		'analytics',
		{ event, data, message },
		'Analytics',
		AMPLIFY_SYMBOL
	);
};
github aws-amplify / amplify-js / packages / analytics / src / Providers / AWSPinpointProvider.ts View on Github external
const dispatchAnalyticsEvent = (event, data) => {
	Hub.dispatch('analytics', { event, data }, 'Analytics', AMPLIFY_SYMBOL);
};