Gutenberg: How to enqueue scripts conditionally in render_callback by checking for an attribute?

Gutenberg: How to enqueue scripts conditionally in render_callback by checking for an attribute?