From 369a519dfc1dbc82a6cbc5f5aebf104b1663baa5 Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Sat, 9 Dec 2023 18:32:57 -0800 Subject: [PATCH] docs: fix return signature of peekRequest (#9161) --- packages/core-types/src/cache.ts | 6 +++++- packages/json-api/src/-private/cache.ts | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/core-types/src/cache.ts b/packages/core-types/src/cache.ts index 010c342b9e6..7c9e3653e67 100644 --- a/packages/core-types/src/cache.ts +++ b/packages/core-types/src/cache.ts @@ -144,9 +144,13 @@ export interface Cache { * Peek the Cache for the existing request data associated with * a cacheable request * + * This is effectively the reverse of `put` for a request in + * that it will return the the request, response, and content + * whereas `peek` will return just the `content`. + * * @method peekRequest * @param {StableDocumentIdentifier} - * @return {StableDocumentIdentifier | null} + * @return {StructuredDocument | null} * @public */ peekRequest(identifier: StableDocumentIdentifier): StructuredDocument | null; diff --git a/packages/json-api/src/-private/cache.ts b/packages/json-api/src/-private/cache.ts index e9afd245b2e..e38bafb1f88 100644 --- a/packages/json-api/src/-private/cache.ts +++ b/packages/json-api/src/-private/cache.ts @@ -481,11 +481,15 @@ export default class JSONAPICache implements Cache { /** * Peek the Cache for the existing request data associated with - * a cacheable request + * a cacheable request. + * + * This is effectively the reverse of `put` for a request in + * that it will return the the request, response, and content + * whereas `peek` will return just the `content`. * * @method peekRequest * @param {StableDocumentIdentifier} - * @return {StableDocumentIdentifier | null} + * @return {StructuredDocument | null} * @public */ peekRequest(identifier: StableDocumentIdentifier): StructuredDocument | null {