mirror of
https://github.com/google/blockly.git
synced 2026-01-18 06:17:12 +01:00
* feat: add interface and method for updating procedure blocks * chore: remove module ID declarations * feat: add actually triggering updates * chore: format * chore: clean up tests
23 lines
500 B
TypeScript
23 lines
500 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2022 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import {isProcedureBlock} from '../interfaces/i_procedure_block.js';
|
|
import {Workspace} from '../workspace.js';
|
|
|
|
|
|
/**
|
|
* Calls the `doProcedureUpdate` method on all blocks which implement it.
|
|
*
|
|
* @internal
|
|
*/
|
|
export function triggerProceduresUpdate(workspace: Workspace) {
|
|
for (const block of workspace.getAllBlocks(false)) {
|
|
if (isProcedureBlock(block)) {
|
|
block.doProcedureUpdate();
|
|
}
|
|
}
|
|
}
|