title: Gutenberg - Looking to inject block data into wp_head on save
body: <p>I have created a code editor block where the user can insert CSS styles.  Rather than having these save to the post_content and show up in the body, I would like for them to be injected into the head. </p>
  
  <p>I have done this in the past using PHP hooks but cant seem to figure out how to translate that to the new JS API hook format</p>
  
  <p>I found this for adding through functions.php:</p>
  
  <pre><code>function hook_css() {
      ?&gt;
          &lt;style&gt;
              .wp_head_example {
                  background-color : #f1f1f1;
              }
          &lt;/style&gt;
      &lt;?php
  }
  add_action('wp_head', 'hook_css');
  </code></pre>
  
  <p>But I would like to achieve this on a block level basis using dynamic data from the user input. Any help would be much appreciated!</p>