Skip to content

Commit

Permalink
Merge a30ae78 into fcac7be
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkirsz authored Jul 13, 2023
2 parents fcac7be + a30ae78 commit 697ea3c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion crates/turbopack-core/src/changed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use turbo_tasks::{
};

use crate::{
asset::{Asset, AssetVc},
asset::{Asset, AssetVc, AssetsVc},
reference::all_referenced_assets,
};

Expand Down Expand Up @@ -33,6 +33,21 @@ pub async fn any_content_changed(root: AssetVc) -> Result<CompletionVc> {
Ok(CompletionsVc::cell(completions).completed())
}

/// Returns a completion that changes when any content of any asset in the given
/// asset graphs changes.
#[turbo_tasks::function]
pub async fn any_content_changed_of_assets(roots: AssetsVc) -> Result<CompletionVc> {
Ok(CompletionsVc::cell(
roots
.await?
.iter()
.copied()
.map(any_content_changed)
.collect(),
)
.completed())
}

/// Returns a completion that changes when the content of the given asset
/// changes.
#[turbo_tasks::function]
Expand Down

0 comments on commit 697ea3c

Please sign in to comment.