* Recomputes the plugin list using the injected plugins and plugin ordering. * * @private
()
| 1285 | * @private |
| 1286 | */ |
| 1287 | function recomputePluginOrdering() { |
| 1288 | if (!eventPluginOrder) { |
| 1289 | // Wait until an `eventPluginOrder` is injected. |
| 1290 | return; |
| 1291 | } |
| 1292 | for (var pluginName in namesToPlugins) { |
| 1293 | var pluginModule = namesToPlugins[pluginName]; |
| 1294 | var pluginIndex = eventPluginOrder.indexOf(pluginName); |
| 1295 | !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0; |
| 1296 | if (plugins[pluginIndex]) { |
| 1297 | continue; |
| 1298 | } |
| 1299 | !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0; |
| 1300 | plugins[pluginIndex] = pluginModule; |
| 1301 | var publishedEvents = pluginModule.eventTypes; |
| 1302 | for (var eventName in publishedEvents) { |
| 1303 | !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0; |
| 1304 | } |
| 1305 | } |
| 1306 | } |
| 1307 | |
| 1308 | /** |
| 1309 | * Publishes an event so that it can be dispatched by the supplied plugin. |
no test coverage detected