@windy/broadcast
Major Windy's event emitter (instance of class Evented), used for announcing the most important events.
Example
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
Name | Type |
---|---|
T | extends keyof Plugins |
Hierarchy
↳
BcastTypes
Table of contents
Properties
- closeAllPlugins
- dependenciesResolved
- globe-poi-airq
- globe-poi-cams
- globe-poi-cities
- globe-poi-empty
- globe-poi-favs
- globe-poi-firespots
- globe-poi-kitespots
- globe-poi-metars
- globe-poi-pgspots
- globe-poi-precip
- globe-poi-radiation
- globe-poi-radiosonde
- globe-poi-surfspots
- globe-poi-temp
- globe-poi-tide
- globe-poi-wind
- metricChanged
- paramsChanged
- pluginClosed
- pluginOpened
- redrawFinished
- redrawLayers
- routerParsed
- rqstClose
- rqstOpen
Properties
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
globe-poi-airq
• globe-poi-airq: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-airq
globe-poi-cams
• globe-poi-cams: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-cams
globe-poi-cities
• globe-poi-cities: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-cities
globe-poi-empty
• globe-poi-empty: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-empty
globe-poi-favs
• globe-poi-favs: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-favs
globe-poi-firespots
• globe-poi-firespots: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-firespots
globe-poi-kitespots
• globe-poi-kitespots: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-kitespots
globe-poi-metars
• globe-poi-metars: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-metars
globe-poi-pgspots
• globe-poi-pgspots: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-pgspots
globe-poi-precip
• globe-poi-precip: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-precip
globe-poi-radiation
• globe-poi-radiation: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-radiation
globe-poi-radiosonde
• globe-poi-radiosonde: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-radiosonde
globe-poi-surfspots
• globe-poi-surfspots: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-surfspots
globe-poi-temp
• globe-poi-temp: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-temp
globe-poi-tide
• globe-poi-tide: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-tide
globe-poi-wind
• globe-poi-wind: [HTMLElement
, NonNullable
<MonkeyPatchedFavs
>]
Inherited from
BcastTypesNonGeneric.globe-poi-wind
metricChanged
• metricChanged: [keyof MetricTypes
, MetricItem
]
Indicates that user changed any of the units (wind, temp, ...).
Inherited from
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
pluginClosed
• pluginClosed: [string
]
Plugin was successfully loaded and closed
Inherited from
pluginOpened
• pluginOpened: [string
]
Plugin was succesfully closed
Inherited from
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
routerParsed
• routerParsed: [void
| `windy-plugin-${string}` | keyof Plugins]
Indicates, that router has parsed URL and launched plugin that was requested in URL
Inherited from
rqstClose
• rqstClose: [string
| T
]
Request to close plugin (either internal or external)
Inherited from
rqstOpen
• rqstOpen: [string
| T
, PluginsOpenParams
[T
]]
Request to open plugin (either internal or external)