Skip to content

Conversation

@tabkram
Copy link
Owner

@tabkram tabkram commented Apr 10, 2025

It's possible now to bypass existing cached value dynamically through a provided function,

Example:

import { cache } from "execution-engine";

class ExampleService {
  @cache({ ttl: 5000, bypass: () => true })  // Store result for 5 seconds BUT bypass it
  async fetchData(id: number): Promise<string> {
    console.log('Fetching data...');
    return `Data for ${id}`;
  }
}

const service = new ExampleService();
console.log(await service.fetchData(1));  // Fetches data and stores it
console.log(await service.fetchData(1));  // DO NOT REUSE stored result bypass it instead

@tabkram tabkram self-assigned this Apr 10, 2025
@tabkram tabkram added the deploy deploy a canary version to NPM label Apr 10, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Apr 10, 2025

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
96.17% (+0.01% 🔼)
402/418
🟢 Branches
87.45% (+0.19% 🔼)
237/271
🟢 Functions 94.74% 108/114
🟢 Lines
96.73% (+0.01% 🔼)
384/397

Test suite run success

86 tests passing in 12 suites.

Report generated by 🧪jest coverage report action from 13658aa

@github-actions
Copy link
Contributor

🚫 Unpublished versions: ∅
Created Version: 3.4.0-canary.70.6729add
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Contributor

🚫 Unpublished versions: 3.4.0-canary.70.6729add
Created Version: 3.4.0-canary.70.b9a7973
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@tabkram tabkram merged commit 8b6e634 into main Apr 10, 2025
8 checks passed
@github-actions
Copy link
Contributor

🚫 Unpublished versions: 3.4.0-canary.70.b9a7973

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy deploy a canary version to NPM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants