Skip to content

Commit 8fbc6b2

Browse files
kriszypclaude
andauthored
fix(caching-guide): correct jokeAPI.get() signature in complete example (#521)
The 'Putting It All Together' example used `async get()` with `this.getId()` which throws at runtime. The correct signature is `async get(id)` — consistent with the earlier 'Wrapping an External Data Source' section and the working caching-guide-example repo. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent feea8f0 commit 8fbc6b2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎learn/developers/caching-with-harper.mdx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@ Here is the complete `resources.js` for this guide:
335335
// resources.js
336336

337337
const jokeAPI = {
338-
async get() {
339-
const id = this.getId();
338+
async get(id) {
340339
const response = await fetch(`https://official-joke-api.appspot.com/jokes/${id}`);
341340
return response.json();
342341
},

0 commit comments

Comments
 (0)