private initDispatch()

in src/orchestration/Orchestration.ts [307:328]


    private initDispatch(region: string) {
        const dispatch: Dispatch = new Dispatch(
            region,
            this.config.endpoint,
            this.eventCache,
            this.config
        );

        if (this.config.identityPoolId && this.config.guestRoleArn) {
            dispatch.setAwsCredentials(
                new Authentication(this.config)
                    .ChainAnonymousCredentialsProvider
            );
        } else if (this.config.identityPoolId) {
            dispatch.setAwsCredentials(
                new EnhancedAuthentication(this.config)
                    .ChainAnonymousCredentialsProvider
            );
        }

        return dispatch;
    }