You are here

public function GatsbyPreview::gatsbyUpdate in Gatsby Live Preview & Incremental Builds 2.0.x

Same name and namespace in other branches
  1. 8 src/GatsbyPreview.php \Drupal\gatsby\GatsbyPreview::gatsbyUpdate()

Triggers the refreshing of Gatsby preview and incremental builds.

File

src/GatsbyPreview.php, line 165

Class

GatsbyPreview
Defines a class for generating Gatsby based previews.

Namespace

Drupal\gatsby

Code

public function gatsbyUpdate() {
  foreach (self::$updateData as $urls) {
    foreach ($urls as $data) {
      $this
        ->triggerRefresh($data['url'], $data['json'], $data['path']);
    }
  }

  // Reset update data to ensure it's only processed once.
  self::$updateData = [];
}