interface PapiNetworkService {
    createNetworkEventEmitter: (<T>(eventType: string) => PlatformEventEmitter<T>);
    getNetworkEvent: (<T>(eventType: string) => PlatformEvent<T>);
}

Properties

createNetworkEventEmitter: (<T>(eventType: string) => PlatformEventEmitter<T>)

Type declaration

    • <T>(eventType): PlatformEventEmitter<T>
    • Creates an event emitter that works properly over the network. Other connections receive this event when it is emitted.

      WARNING: You can only create a network event emitter once per eventType to prevent hijacked event emitters.

      Type Parameters

      • T

      Parameters

      • eventType: string

        Unique network event type for coordinating between connections

      Returns PlatformEventEmitter<T>

      Event emitter whose event works between connections

getNetworkEvent: (<T>(eventType: string) => PlatformEvent<T>)

Type declaration

    • <T>(eventType): PlatformEvent<T>
    • Gets the network event with the specified type. Creates the emitter if it does not exist

      Type Parameters

      • T

      Parameters

      • eventType: string

        Unique network event type for coordinating between connections

      Returns PlatformEvent<T>

      Event for the event type that runs the callback provided when the event is emitted