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

Function recomputePluginOrdering

code/styling/public/app.js:1926–1945  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

1924 * @private
1925 */
1926function 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.

Callers 2

injectEventPluginOrderFunction · 0.70
injectEventPluginsByNameFunction · 0.70

Calls 2

invariantFunction · 0.70
publishEventForPluginFunction · 0.70

Tested by

no test coverage detected