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

Function publishRegistrationName

code/styling/public/app.js:1982–1995  ·  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

1980 * @private
1981 */
1982function publishRegistrationName(registrationName, pluginModule, eventName) {
1983 !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;
1984 registrationNameModules[registrationName] = pluginModule;
1985 registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
1986
1987 {
1988 var lowerCasedName = registrationName.toLowerCase();
1989 possibleRegistrationNames[lowerCasedName] = registrationName;
1990
1991 if (registrationName === 'onDoubleClick') {
1992 possibleRegistrationNames.ondblclick = registrationName;
1993 }
1994 }
1995}
1996
1997/**
1998 * 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