Skip to content

Commit 1f3e289

Browse files
Apply suggestions from code review
Co-authored-by: Victor Berchet <[email protected]>
1 parent 121c363 commit 1f3e289

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/cloudflare/src/api/config.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export type CloudflareConfigOptions = {
1616
* incrementalCache: cache,
1717
* });
1818
*/
19-
incrementalCache?: IncrementalCache | (() => IncrementalCache | Promise<IncrementalCache>);
19+
incrementalCache?: "dummy" | IncrementalCache | (() => IncrementalCache | Promise<IncrementalCache>);
2020

2121
/**
2222
* The tag cache implementation to use, for more details see the [Caching documentation](https://opennext.js.org/cloudflare/caching))
@@ -32,7 +32,7 @@ export type CloudflareConfigOptions = {
3232
* tagCache: cache,
3333
* });
3434
*/
35-
tagCache?: TagCache | (() => TagCache | Promise<TagCache>);
35+
tagCache?: "dummy" | TagCache | (() => TagCache | Promise<TagCache>);
3636

3737
/**
3838
* The revalidation queue implementation to use, for more details see the [Caching documentation](https://opennext.js.org/cloudflare/caching))
@@ -48,7 +48,7 @@ export type CloudflareConfigOptions = {
4848
* queue: memoryQueue,
4949
* });
5050
*/
51-
queue?: Queue | (() => Queue | Promise<Queue>);
51+
queue?: "dummy" | "direct" | Queue | (() => Queue | Promise<Queue>);
5252
};
5353

5454
/**
@@ -88,9 +88,5 @@ function resolveOverride<T extends IncrementalCache | TagCache | Queue>(
8888
return "dummy";
8989
}
9090

91-
if (typeof value === "function") {
92-
return () => value();
93-
}
94-
95-
return async () => value;
91+
return typeof value === "function" ? value : () => value;
9692
}

0 commit comments

Comments
 (0)