* Recomputes the plugin list using the injected plugins and plugin ordering. * * @private
()
| 1959 | * @private |
| 1960 | */ |
| 1961 | function recomputePluginOrdering() { |
| 1962 | if (!eventPluginOrder) { |
| 1963 | // Wait until an `eventPluginOrder` is injected. |
| 1964 | return; |
| 1965 | } |
| 1966 | for (var pluginName in namesToPlugins) { |
| 1967 | var pluginModule = namesToPlugins[pluginName]; |
| 1968 | var pluginIndex = eventPluginOrder.indexOf(pluginName); |
| 1969 | !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0; |
| 1970 | if (plugins[pluginIndex]) { |
| 1971 | continue; |
| 1972 | } |
| 1973 | !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0; |
| 1974 | plugins[pluginIndex] = pluginModule; |
| 1975 | var publishedEvents = pluginModule.eventTypes; |
| 1976 | for (var eventName in publishedEvents) { |
| 1977 | !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0; |
| 1978 | } |
| 1979 | } |
| 1980 | } |
| 1981 | |
| 1982 | /** |
| 1983 | * Publishes an event so that it can be dispatched by the supplied plugin. |
no test coverage detected