MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / recomputePluginOrdering

Function recomputePluginOrdering

code/third-party/public/app.js:1159–1178  ·  view source on GitHub ↗

* Recomputes the plugin list using the injected plugins and plugin ordering. * * @private

()

Source from the content-addressed store, hash-verified

1157 * @private
1158 */
1159function 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.

Callers 2

injectEventPluginOrderFunction · 0.70
injectEventPluginsByNameFunction · 0.70

Calls 2

invariantFunction · 0.70
publishEventForPluginFunction · 0.70

Tested by

no test coverage detected