MCPcopy Create free account
hub / github.com/danielstocks/react-sortable / publishEventForPlugin

Function publishEventForPlugin

bundle.js:5454–5454  ·  view source on GitHub ↗

* Publishes an event so that it can be dispatched by the supplied plugin. * * @param {object} dispatchConfig Dispatch configuration for the event. * @param {object} PluginModule Plugin publishing the event. * @return {boolean} True if the event was successfully published. * @private

(dispatchConfig,pluginModule,eventName)

Source from the content-addressed store, hash-verified

5452 * @return {boolean} True if the event was successfully published.
5453 * @private
5454 */function publishEventForPlugin(dispatchConfig,pluginModule,eventName){!!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName)?invariant(false,'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.',eventName):void 0;EventPluginRegistry.eventNameDispatchConfigs[eventName]=dispatchConfig;var phasedRegistrationNames=dispatchConfig.phasedRegistrationNames;if(phasedRegistrationNames){for(var phaseName in phasedRegistrationNames){if(phasedRegistrationNames.hasOwnProperty(phaseName)){var phasedRegistrationName=phasedRegistrationNames[phaseName];publishRegistrationName(phasedRegistrationName,pluginModule,eventName);}}return true;}else if(dispatchConfig.registrationName){publishRegistrationName(dispatchConfig.registrationName,pluginModule,eventName);return true;}return false;}/**
5455 * Publishes a registration name that is used to identify dispatched events.
5456 *
5457 * @param {string} registrationName Registration name to add.

Callers 1

recomputePluginOrderingFunction · 0.85

Calls 2

publishRegistrationNameFunction · 0.85
invariantFunction · 0.70

Tested by

no test coverage detected