Skip to content

Commit

Permalink
Merge pull request #1 from jorgecasar/fix/unqueue-typo
Browse files Browse the repository at this point in the history
fix: deprectate enqueCommand in favor of enqueueCommand
  • Loading branch information
julcasans authored May 29, 2024
2 parents 18648fb + 9cc6ddb commit f990a57
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion packages/core/src/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,22 @@ export const getConfig = function () {
return $config;
};


/**
* Enqueues a bridge command due to delayed instance of bridge and premature execution of commands.
*
* @param {string} command - The command to be enqueued.
* @param {any[]} parameters - The parameters to be enqueued.
*/
export const enqueCommand = function (command, parameters) {
export const enqueueCommand = function (command, parameters) {
$queueCommands.push({ command, parameters });
};

/**
* @deprecated Use {@link enqueueCommand} instead
*/
export const enqueCommand = enqueueCommand;

/**
* Constants object containing various constant values.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { $bridge, Bridge, enqueCommand, startApp, getConfig } from './bridge';
export { $bridge, Bridge, enqueCommand, enqueueCommand, startApp, getConfig } from './bridge';
4 changes: 2 additions & 2 deletions packages/element-controller/src/ElementController.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { $bridge, enqueCommand } from '@open-cells/core';
import { $bridge, enqueueCommand } from '@open-cells/core';

function __callBridge(...args) {
const [command, ...parameters] = args;
Expand All @@ -14,7 +14,7 @@ function __callBridge(...args) {
return result;
}

enqueCommand(command, parameters);
enqueueCommand(command, parameters);
return result;
}

Expand Down

0 comments on commit f990a57

Please sign in to comment.