* Recomputes the plugin list using the injected plugins and plugin ordering. * * @private
()
| 1924 | * @private |
| 1925 | */ |
| 1926 | function recomputePluginOrdering() { |
| 1927 | if (!eventPluginOrder) { |
| 1928 | // Wait until an `eventPluginOrder` is injected. |
| 1929 | return; |
| 1930 | } |
| 1931 | for (var pluginName in namesToPlugins) { |
| 1932 | var pluginModule = namesToPlugins[pluginName]; |
| 1933 | var pluginIndex = eventPluginOrder.indexOf(pluginName); |
| 1934 | !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0; |
| 1935 | if (plugins[pluginIndex]) { |
| 1936 | continue; |
| 1937 | } |
| 1938 | !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0; |
| 1939 | plugins[pluginIndex] = pluginModule; |
| 1940 | var publishedEvents = pluginModule.eventTypes; |
| 1941 | for (var eventName in publishedEvents) { |
| 1942 | !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0; |
| 1943 | } |
| 1944 | } |
| 1945 | } |
| 1946 | |
| 1947 | /** |
| 1948 | * Publishes an event so that it can be dispatched by the supplied plugin. |
no test coverage detected