MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / registerAction

Function registerAction

libs/echarts/echarts-en.simple.js:29334–29356  ·  view source on GitHub ↗

* Usage: * registerAction('someAction', 'someEvent', function () { ... }); * registerAction('someAction', function () { ... }); * registerAction( * {type: 'someAction', event: 'someEvent', update: 'updateView'}, * function () { ... } * ); * * @param {(string|Object)} actionInfo * @p

(actionInfo, eventName, action)

Source from the content-addressed store, hash-verified

29332 * @param {Function} action
29333 */
29334function registerAction(actionInfo, eventName, action) {
29335 if (typeof eventName === 'function') {
29336 action = eventName;
29337 eventName = '';
29338 }
29339 var actionType = isObject(actionInfo)
29340 ? actionInfo.type
29341 : ([actionInfo, actionInfo = {
29342 event: eventName
29343 }][0]);
29344
29345 // Event name is all lowercase
29346 actionInfo.event = (actionInfo.event || actionType).toLowerCase();
29347 eventName = actionInfo.event;
29348
29349 // Validate action type and event name.
29350 assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));
29351
29352 if (!actions[actionType]) {
29353 actions[actionType] = {action: action, actionInfo: actionInfo};
29354 }
29355 eventActionMap[eventName] = actionType;
29356}
29357
29358/**
29359 * @param {string} type

Callers 2

createDataSelectActionFunction · 0.70

Calls 1

isObjectFunction · 0.50

Tested by

no test coverage detected