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

Function recomputePluginOrdering

code/composition/public/app.js:2064–2083  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

2062 * @private
2063 */
2064function 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.

Callers 2

injectEventPluginOrderFunction · 0.70
injectEventPluginsByNameFunction · 0.70

Calls 2

invariantFunction · 0.70
publishEventForPluginFunction · 0.70

Tested by

no test coverage detected