* Recomputes the plugin list using the injected plugins and plugin ordering. * * @private
()
| 2062 | * @private |
| 2063 | */ |
| 2064 | function recomputePluginOrdering() { |
| 2065 | if (!eventPluginOrder) { |
| 2066 | // Wait until an `eventPluginOrder` is injected. |
| 2067 | return; |
| 2068 | } |
| 2069 | for (var pluginName in namesToPlugins) { |
| 2070 | var pluginModule = namesToPlugins[pluginName]; |
| 2071 | var pluginIndex = eventPluginOrder.indexOf(pluginName); |
| 2072 | !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0; |
| 2073 | if (plugins[pluginIndex]) { |
| 2074 | continue; |
| 2075 | } |
| 2076 | !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0; |
| 2077 | plugins[pluginIndex] = pluginModule; |
| 2078 | var publishedEvents = pluginModule.eventTypes; |
| 2079 | for (var eventName in publishedEvents) { |
| 2080 | !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0; |
| 2081 | } |
| 2082 | } |
| 2083 | } |
| 2084 | |
| 2085 | /** |
| 2086 | * Publishes an event so that it can be dispatched by the supplied plugin. |
no test coverage detected