chore: move remaining functions out of utils.js (#5714)

* chore: move arrayRemove to a new utils.array namespace

* chore: move getBlockTypeCounts out of utils.js

* chore: remove last functions from utils.js

* chore: reorder imports

* chore: add re-export for runAfterPageLoad
This commit is contained in:
Rachel Fenichel
2021-11-15 18:12:45 -08:00
committed by GitHub
parent 969fcac455
commit 075385c87c
15 changed files with 174 additions and 96 deletions

View File

@@ -17,8 +17,8 @@
*/
goog.module('Blockly.ThemeManager');
const arrayUtils = goog.require('Blockly.utils.array');
const dom = goog.require('Blockly.utils.dom');
const utils = goog.require('Blockly.utils');
/* eslint-disable-next-line no-unused-vars */
const {Theme} = goog.requireType('Blockly.Theme');
/* eslint-disable-next-line no-unused-vars */
@@ -138,7 +138,7 @@ ThemeManager.prototype.subscribeWorkspace = function(workspace) {
* @package
*/
ThemeManager.prototype.unsubscribeWorkspace = function(workspace) {
if (!utils.arrayRemove(this.subscribedWorkspaces_, workspace)) {
if (!arrayUtils.removeElem(this.subscribedWorkspaces_, workspace)) {
throw Error('Cannot unsubscribe a workspace that hasn\'t been subscribed.');
}
};