* Recomputes the plugin list using the injected plugins and plugin ordering. * * @private
()
| 1157 | * @private |
| 1158 | */ |
| 1159 | function recomputePluginOrdering() { |
| 1160 | if (!eventPluginOrder) { |
| 1161 | // Wait until an `eventPluginOrder` is injected. |
| 1162 | return; |
| 1163 | } |
| 1164 | for (var pluginName in namesToPlugins) { |
| 1165 | var pluginModule = namesToPlugins[pluginName]; |
| 1166 | var pluginIndex = eventPluginOrder.indexOf(pluginName); |
| 1167 | !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0; |
| 1168 | if (plugins[pluginIndex]) { |
| 1169 | continue; |
| 1170 | } |
| 1171 | !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0; |
| 1172 | plugins[pluginIndex] = pluginModule; |
| 1173 | var publishedEvents = pluginModule.eventTypes; |
| 1174 | for (var eventName in publishedEvents) { |
| 1175 | !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0; |
| 1176 | } |
| 1177 | } |
| 1178 | } |
| 1179 | |
| 1180 | /** |
| 1181 | * Publishes an event so that it can be dispatched by the supplied plugin. |
no test coverage detected