Skip to content

Commit

Permalink
Deprecate Turbo.clearCache()
Browse files Browse the repository at this point in the history
`Turbo.clearCache()` is depreatec in favor of `Turbo.cache.clear()`

Related: hotwired#632
  • Loading branch information
marcoroth committed Jul 18, 2022
1 parent 837e977 commit 0cc0641
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/index.ts
Expand Up @@ -97,8 +97,13 @@ export function renderStreamMessage(message: StreamMessage | string) {
/**
* Removes all entries from the Turbo Drive page cache.
* Call this when state has changed on the server that may affect cached pages.
*
* @deprecated since version 7.2.0 in favor of `Turbo.cache.clear()`
*/
export function clearCache() {
console.warn(
"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"
)
session.clearCache()
}

Expand Down

0 comments on commit 0cc0641

Please sign in to comment.