Skip to content

Commit

Permalink
feat(core): ✨ add cacheFirstPage option
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierfoucrier committed Jul 31, 2023
1 parent 4c97b59 commit 4306972
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class Core {
*/
public timeout: number;
public cacheIgnore: IgnoreOption;
public cacheFirstPage: boolean;
public prefetchIgnore: IgnoreOption;
public preventRunning: boolean;
/**
Expand Down Expand Up @@ -140,6 +141,7 @@ export class Core {
* - schema: [[SchemaAttribute]]
* - timeout: `2e3`
* - cacheIgnore: `false`
* - cacheFirstPage: `false`
* - prefetchIgnore: `false`
* - preventRunning: `false`
* - prevent: `null`,
Expand All @@ -154,6 +156,7 @@ export class Core {
requestError,
timeout = 2e3,
cacheIgnore = false,
cacheFirstPage = false,
prefetchIgnore = false,
/* istanbul ignore next */
preventRunning = false,
Expand All @@ -178,6 +181,7 @@ export class Core {
this._requestCustomError = requestError;
this.timeout = timeout;
this.cacheIgnore = cacheIgnore;
this.cacheFirstPage = cacheFirstPage;
this.prefetchIgnore = prefetchIgnore;
this.preventRunning = preventRunning;

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/defs/barba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface IBarbaOptions {
requestError?: RequestCustomError | undefined;
/** Disable cache or ignore some routes. */
cacheIgnore?: IgnoreOption;
/** Disable cache on the first rendered page. */
cacheFirstPage?: boolean;
/** Disable prefetch or ignore routes. */
prefetchIgnore?: IgnoreOption;
/** Custom prevent check. */
Expand Down

0 comments on commit 4306972

Please sign in to comment.