let platform: any;

// return the current platform if there is one,
// otherwise open up a new platform
export function getPlatform(appId: string, appCode: string) {
    if (platform) return platform;

    platform = new H.service.Platform({
        'app_id': appId,
        'app_code': appCode,
    });

    return platform;
}

// make the getPlatform method the default export
export default getPlatform;

let platform: any;

// return the current platform if there is one,
// otherwise open up a new platform
export function getPlatform(platformOptions: H.service.Platform.Options) {
    if (platform) return platform;

    platform = new H.service.Platform(platformOptions);

    return platform;
}

// make the getPlatform method the default export
export default getPlatform;

Support all platform options in getPlatform utility.
Support all platform options in getPlatform utility.
