Skip to content

Commit ef62094

Browse files
runspiredBaltazore
authored andcommitted
docs: fix return signature of peekRequest (emberjs#9161)
1 parent 022ec9d commit ef62094

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

packages/core-types/src/cache.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,13 @@ export interface Cache {
144144
* Peek the Cache for the existing request data associated with
145145
* a cacheable request
146146
*
147+
* This is effectively the reverse of `put` for a request in
148+
* that it will return the the request, response, and content
149+
* whereas `peek` will return just the `content`.
150+
*
147151
* @method peekRequest
148152
* @param {StableDocumentIdentifier}
149-
* @return {StableDocumentIdentifier | null}
153+
* @return {StructuredDocument<ResourceDocument> | null}
150154
* @public
151155
*/
152156
peekRequest(identifier: StableDocumentIdentifier): StructuredDocument<ResourceDocument> | null;

packages/json-api/src/-private/cache.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,15 @@ export default class JSONAPICache implements Cache {
481481

482482
/**
483483
* Peek the Cache for the existing request data associated with
484-
* a cacheable request
484+
* a cacheable request.
485+
*
486+
* This is effectively the reverse of `put` for a request in
487+
* that it will return the the request, response, and content
488+
* whereas `peek` will return just the `content`.
485489
*
486490
* @method peekRequest
487491
* @param {StableDocumentIdentifier}
488-
* @return {StableDocumentIdentifier | null}
492+
* @return {StructuredDocument<ResourceDocument> | null}
489493
* @public
490494
*/
491495
peekRequest(identifier: StableDocumentIdentifier): StructuredDocument<ResourceDocument> | null {

0 commit comments

Comments
 (0)