UNPKG

@wscsports/blaze-rtn-sdk

Version:
32 lines 1.11 kB
import { BlazeGlobalEvents } from '../shared/BlazeGlobalEvents'; export class BlazeFollowEntitiesDelegateHelper { static registerFollowEntitiesDelegate(delegate) { BlazeFollowEntitiesDelegateHelper.onFollowEntityClicked(delegate?.onFollowEntityClicked); } static onFollowEntityClicked(callback) { const eventName = 'Blaze.onFollowEntityClicked'; if (callback) { BlazeGlobalEvents.createEventSubscription(eventName, data => { try { const playerType = data['playerType']; const sourceId = data['sourceId']; const newFollowingState = data['newFollowingState']; const followEntity = { id: data['followEntityId'] }; callback({ playerType, sourceId, newFollowingState, followEntity }); } catch (e) { console.error('BlazeFollowEntitiesDelegateHelper.onFollowEntityClicked', e); } }); } else { BlazeGlobalEvents.cancelEventSubscription(eventName); } } } //# sourceMappingURL=follow-entities-delegate.js.map