Tutorial: Platform.EventEmitter

Platform.EventEmitter

The Platform EventEmitter is a superset of the Application's EventEmitter, meaning it can listen to all Application events, along with some Platform-specific events.

Supported platform event types

Platform-specific events

platform-api-ready

Generated when a new Platform's API becomes responsive.

//This response has the following shape:
{
    topic: "application",
    type: "platform-api-ready",
    uuid: "454C7F31-A915-4EA2-83F2-CFA655453C52" // the UUID of the application
}

platform-snapshot-applied

Generated when a platform.ApplySnapshot call is resolved.
The call is resolved when the following conditions are met for all windows in the snapshot:

  1. The window has been created
  2. The window has a responsive API
  3. If a window has a layout property, the 'layout-ready' event has fired

Note - In the case of using a custom provider, if a window has a layout property but does not call Layout.init this event may not fire.

//This response has the following shape:
{
    topic: "application",
    type: "platform-snapshot-applied",
    uuid: "454C7F31-A915-4EA2-83F2-CFA655453C52" // the UUID of the application
    snapshot: {windows: Array(2), ...} // the applied snapshot
}