Skip to content

@windy/broadcast

Major Windy's event emitter (instance of class Evented), used for announcing the most important events.

Example

js
import broadcast from '@windy/broadcast';

const listener = params => console.log('Params has changed', params);

broadcast.on('redrawFinished', listener );

broadcast.once('metricChanged', params => {
    // This method will be called just once
});

// Do not forget to unsubscribe any listener
broadcast.off('redrawFinished', listener);

// Let's fire some event
broadcast.emit('rqstOpen', 'menu');

Type parameters

NameType
Textends keyof Plugins

Hierarchy

Table of contents

Properties

Properties

alertChanged

alertChanged: []

Indicates that user added, remover or rename his alert

Inherited from

BasicBcastTypes.alertChanged


closeAllPlugins

closeAllPlugins: [] | [keyof Plugins]

Request to close all opened plugins (unless plugin has noClose property)

Inherited from

BasicBcastTypes.closeAllPlugins


dependenciesResolved

dependenciesResolved: []

Basically most important broadcast of all, triggered just once, when Windy.com has been successfully loaded and all modules are ready to be consumed

Inherited from

BasicBcastTypes.dependenciesResolved


favChanged

favChanged: []

Indicates that user added, remover or rename his fav

Inherited from

BasicBcastTypes.favChanged


metricChanged

metricChanged: [keyof MetricTypes, MetricItem]

Indicates that user changed any of the units (wind, temp, ...).

Inherited from

BasicBcastTypes.metricChanged


paramsChanged

paramsChanged: [WeatherParameters, keyof WeatherParameters]

When user changes some parameters (overlay, level, date etc...). Do not not use this event to start any intensive action since Windy now must load and render all the data. We recommend to use redrawFinished instead.

Inherited from

BasicBcastTypes.paramsChanged


pluginClosed

pluginClosed: [string]

Plugin was successfully loaded and closed

Inherited from

BasicBcastTypes.pluginClosed


pluginMounted

pluginMounted: [string]

Svelte plugin was successfully mounted

Inherited from

BasicBcastTypes.pluginMounted


pluginOpened

pluginOpened: [string]

Plugin was successfully closed

Inherited from

BasicBcastTypes.pluginOpened


redrawFinished

redrawFinished: [WeatherParameters]

Triggered when Windy has successfully loaded and rendered requested data. Use this for triggering your own tasks.

Inherited from

BasicBcastTypes.redrawFinished


redrawLayers

redrawLayers: [] | [{ noCache: boolean }]

Forces various renderers to render layers, for example after reconfiguring color gradient, or changing particle animation settings.

Inherited from

BasicBcastTypes.redrawLayers


routerParsed

routerParsed: [void | `windy-plugin-${string}` | keyof Plugins]

Indicates, that router has parsed URL and launched plugin that was requested in URL

Inherited from

BasicBcastTypes.routerParsed


rqstClose

rqstClose: [string | T]

Request to close plugin (either internal or external)

Inherited from

BasicBcastTypes.rqstClose


rqstOpen

rqstOpen: [string | T, PluginsOpenParams[T]]

Request to open plugin (either internal or external)

Inherited from

BasicBcastTypes.rqstOpen