WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks

Assets::register_block_script() public WC 2.3.0

Deprecated from version 4.5.0 Block types register the scripts themselves.. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Queues a block script in the frontend.

{} It's a method of the class: Assets{}

No Hooks.

Return

null. Nothing.

Usage

$result = Assets::register_block_script( $script_name, $handle, $dependencies );
$script_name(string) (required)
Name of the script used to identify the file inside build folder.
$handle(string)
Provided if the handle should be different than the script name. wc- prefix automatically added.
Default: ''
$dependencies(array)
An array of registered script handles this script depends on.
Default: empty array

Changelog

Since 2.3.0 Introduced.
Since 2.6.0 Changed $name to $script_name and added $handle argument.
Since 2.9.0 Made it so scripts are not loaded in admin pages.
Deprecated Since 4.5.0 Block types register the scripts themselves.

Code of Assets::register_block_script() WC 5.8.0

public static function register_block_script( $script_name, $handle = '', $dependencies = [] ) {
	_deprecated_function( 'register_block_script', '4.5.0' );
	$asset_api = Package::container()->get( AssetApi::class );
	$asset_api->register_block_script( $script_name, $handle, $dependencies );
}