MCPcopy Create free account
hub / github.com/microsoft/SandDance / recomputePluginOrdering

Function recomputePluginOrdering

docs/external/js/react-dom.development.js:457–494  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

455 */
456
457 function recomputePluginOrdering() {
458 if (!eventPluginOrder) {
459 // Wait until an `eventPluginOrder` is injected.
460 return;
461 }
462
463 for (var pluginName in namesToPlugins) {
464 var pluginModule = namesToPlugins[pluginName];
465 var pluginIndex = eventPluginOrder.indexOf(pluginName);
466
467 if (!(pluginIndex > -1)) {
468 {
469 throw Error( "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`." );
470 }
471 }
472
473 if (plugins[pluginIndex]) {
474 continue;
475 }
476
477 if (!pluginModule.extractEvents) {
478 {
479 throw Error( "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not." );
480 }
481 }
482
483 plugins[pluginIndex] = pluginModule;
484 var publishedEvents = pluginModule.eventTypes;
485
486 for (var eventName in publishedEvents) {
487 if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {
488 {
489 throw Error( "EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`." );
490 }
491 }
492 }
493 }
494 }
495 /**
496 * Publishes an event so that it can be dispatched by the supplied plugin.
497 *

Callers 2

injectEventPluginOrderFunction · 0.85
injectEventPluginsByNameFunction · 0.85

Calls 1

publishEventForPluginFunction · 0.85

Tested by

no test coverage detected