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

Function publishRegistrationName

code/composition/public/app.js:2120–2133  ·  view source on GitHub ↗

* Publishes a registration name that is used to identify dispatched events. * * @param {string} registrationName Registration name to add. * @param {object} PluginModule Plugin publishing the event. * @private

(registrationName, pluginModule, eventName)

Source from the content-addressed store, hash-verified

2118 * @private
2119 */
2120function publishRegistrationName(registrationName, pluginModule, eventName) {
2121 !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;
2122 registrationNameModules[registrationName] = pluginModule;
2123 registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
2124
2125 {
2126 var lowerCasedName = registrationName.toLowerCase();
2127 possibleRegistrationNames[lowerCasedName] = registrationName;
2128
2129 if (registrationName === 'onDoubleClick') {
2130 possibleRegistrationNames.ondblclick = registrationName;
2131 }
2132 }
2133}
2134
2135/**
2136 * Registers plugins so that they can extract and dispatch events.

Callers 1

publishEventForPluginFunction · 0.70

Calls 1

invariantFunction · 0.70

Tested by

no test coverage detected